Drush: Drush\Role\RoleBase Class Reference

  1. 7.x doxygen/html/classDrush_1_1Role_1_1RoleBase.html
  2. master doxygen/html/classDrush_1_1Role_1_1RoleBase.html
Inheritance diagram for Drush\Role\RoleBase:

Public Member Functions

 __construct ($rid=DRUPAL_ANONYMOUS_RID)
 getPerms ()
 getModulePerms ($module)
 getAllModulePerms ()
 role_create ($role_machine_name, $role_human_readable_name= '')
 delete ()
 add ($perm)
 remove ($perm)
 grant_permissions ($perms)
 revoke_permissions ($perms)

Public Attributes

 $name
 $rid
 $roles

Detailed Description

Definition at line 5 of file RoleBase.php.

Constructor & Destructor Documentation

Drush\Role\RoleBase::__construct (   $rid = DRUPAL_ANONYMOUS_RID)

This constructor will allow the role to be selected either via the role id or via the role name.

Definition at line 31 of file RoleBase.php.

References dt().

Here is the call graph for this function:

Member Data Documentation

Drupal 7: 'rid' is numeric 'name' is machine name (e.g. 'anonymous user')

Drupal 8: 'rid' is machine name (e.g. 'anonymous') 'name' is human-readable name (e.g. 'Anonymous user').

c.f. http://drupal.org/node/1619504

Definition at line 17 of file RoleBase.php.

This is initialized to the result of the user_roles() function, which returns an associative array of rid => name pairs.

Definition at line 25 of file RoleBase.php.


The documentation for this class was generated from the following file:

File

doxygen/html/classDrush_1_1Role_1_1RoleBase.html
View source
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Drush: Drush\Role\RoleBase Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Drush
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.2 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>Drush</b></li><li class="navelem"><b>Role</b></li><li class="navelem"><a class="el" href="classDrush_1_1Role_1_1RoleBase.html">RoleBase</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="classDrush_1_1Role_1_1RoleBase-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">Drush\Role\RoleBase Class Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="dynheader">
Inheritance diagram for Drush\Role\RoleBase:</div>
<div class="dyncontent">
<div class="center"><img src="classDrush_1_1Role_1_1RoleBase__inherit__graph.png" border="0" usemap="#Drush_0CRole_0CRoleBase_inherit__map" alt="Inheritance graph"/></div>
<map name="Drush_0CRole_0CRoleBase_inherit__map" id="Drush_0CRole_0CRoleBase_inherit__map">
<area shape="rect" id="node3" href="classDrush_1_1Role_1_1Role7.html" title="Drush\\Role\\Role7" alt="" coords="17,83,143,112"/><area shape="rect" id="node5" href="classDrush_1_1Role_1_1Role8.html" title="Drush\\Role\\Role8" alt="" coords="17,160,143,189"/></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a9c7f335ef169571c9caabd354b3b126a"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDrush_1_1Role_1_1RoleBase.html#a9c7f335ef169571c9caabd354b3b126a">__construct</a> ($rid=DRUPAL_ANONYMOUS_RID)</td></tr>
<tr class="memitem:a82c278193eb3c191f5bad2439ccc0afe"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a82c278193eb3c191f5bad2439ccc0afe"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>getPerms</b> ()</td></tr>
<tr class="memitem:a9dbedeabd2279d249d3e11e614340886"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9dbedeabd2279d249d3e11e614340886"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>getModulePerms</b> ($module)</td></tr>
<tr class="memitem:a6963d71cc3712bb033cb3d3ecb476507"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6963d71cc3712bb033cb3d3ecb476507"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>getAllModulePerms</b> ()</td></tr>
<tr class="memitem:adca8d77a02d7b135424bd250c8968d44"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adca8d77a02d7b135424bd250c8968d44"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>role_create</b> ($role_machine_name, $role_human_readable_name= '')</td></tr>
<tr class="memitem:a7438a71d99d365ba0e723e5b183c52a9"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7438a71d99d365ba0e723e5b183c52a9"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>delete</b> ()</td></tr>
<tr class="memitem:a1b6c55c3f85f4448a5eb79931cb48fc5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1b6c55c3f85f4448a5eb79931cb48fc5"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>add</b> ($perm)</td></tr>
<tr class="memitem:a52c26291e3ce5baaedc5abe541387688"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a52c26291e3ce5baaedc5abe541387688"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>remove</b> ($perm)</td></tr>
<tr class="memitem:a28e28c18fd9ce2ae52ac3265dcb1fa2f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a28e28c18fd9ce2ae52ac3265dcb1fa2f"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>grant_permissions</b> ($perms)</td></tr>
<tr class="memitem:a0ff7246fffe34edcb29ab77d778949b9"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0ff7246fffe34edcb29ab77d778949b9"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>revoke_permissions</b> ($perms)</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:aad7ce1b70abe250f7771aa2cb449fb95"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDrush_1_1Role_1_1RoleBase.html#aad7ce1b70abe250f7771aa2cb449fb95">$name</a></td></tr>
<tr class="memitem:af46a298e5a501b2d36f6970bdcec8608"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af46a298e5a501b2d36f6970bdcec8608"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>$rid</b></td></tr>
<tr class="memitem:a86f42c2fad39029ba74710be88f09260"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDrush_1_1Role_1_1RoleBase.html#a86f42c2fad39029ba74710be88f09260">$roles</a></td></tr>
</table>
<a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock">
<p>Definition at line <a class="el" href="RoleBase_8php_source.html#l00005">5</a> of file <a class="el" href="RoleBase_8php_source.html">RoleBase.php</a>.</p>
</div><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a9c7f335ef169571c9caabd354b3b126a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Drush\Role\RoleBase::__construct </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$rid</em> = <code>DRUPAL_ANONYMOUS_RID</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This constructor will allow the role to be selected either via the role id or via the role name. </p>

<p>Definition at line <a class="el" href="RoleBase_8php_source.html#l00031">31</a> of file <a class="el" href="RoleBase_8php_source.html">RoleBase.php</a>.</p>

<p>References <a class="el" href="output_8inc_source.html#l00149">dt()</a>.</p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="classDrush_1_1Role_1_1RoleBase_a9c7f335ef169571c9caabd354b3b126a_cgraph.png" border="0" usemap="#classDrush_1_1Role_1_1RoleBase_a9c7f335ef169571c9caabd354b3b126a_cgraph" alt=""/></div>
<map name="classDrush_1_1Role_1_1RoleBase_a9c7f335ef169571c9caabd354b3b126a_cgraph" id="classDrush_1_1Role_1_1RoleBase_a9c7f335ef169571c9caabd354b3b126a_cgraph">
<area shape="rect" id="node3" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96" title="dt" alt="" coords="204,63,241,92"/><area shape="rect" id="node5" href="drupal_8inc.html#ad2ccab77d4bc8e7355186f26cd328ac0" title="drush_drupal_major\l_version" alt="" coords="293,23,427,70"/><area shape="rect" id="node17" href="group__outputfunctions.html#ga2391425402626377e6464f1f649f8c65" title="find_legacy_dt_args" alt="" coords="291,93,429,123"/><area shape="rect" id="node7" href="drupal_8inc.html#a203e989fd043d054d774954e2b2dff21" title="drush_drupal_version" alt="" coords="479,32,623,61"/><area shape="rect" id="node9" href="classDrush.html#a104f09419bc8a46c4bf205b49268b3a4" title="Drush\\bootstrapManager" alt="" coords="672,5,837,35"/><area shape="rect" id="node15" href="context_8inc.html#ad25559f8d7d753f636fbeac347c29fc5" title="drush_get_context" alt="" coords="691,59,819,88"/><area shape="rect" id="node11" href="classDrush.html#a83560a0aab97e348848b3615f152af54" title="Drush\\service" alt="" coords="887,5,988,35"/><area shape="rect" id="node13" href="classDrush.html#abce7035069a9f7517f908b82bdd4dae0" title="Drush\\getContainer" alt="" coords="1039,5,1172,35"/></map>
</div>
</p>

</div>
</div>
<h2>Member Data Documentation</h2>
<a class="anchor" id="aad7ce1b70abe250f7771aa2cb449fb95"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Drush\Role\RoleBase::$name</td>
        </tr>
      </table>
</div><div class="memdoc">
<p><a class="el" href="namespaceDrupal.html">Drupal</a> 7: 'rid' is numeric 'name' is machine name (e.g. 'anonymous user')</p>
<p><a class="el" href="namespaceDrupal.html">Drupal</a> 8: 'rid' is machine name (e.g. 'anonymous') 'name' is human-readable name (e.g. 'Anonymous user').</p>
<p>c.f. <a href="http://drupal.org/node/1619504">http://drupal.org/node/1619504</a> </p>

<p>Definition at line <a class="el" href="RoleBase_8php_source.html#l00017">17</a> of file <a class="el" href="RoleBase_8php_source.html">RoleBase.php</a>.</p>

</div>
</div>
<a class="anchor" id="a86f42c2fad39029ba74710be88f09260"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Drush\Role\RoleBase::$roles</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This is initialized to the result of the user_roles() function, which returns an associative array of rid =&gt; name pairs. </p>

<p>Definition at line <a class="el" href="RoleBase_8php_source.html#l00025">25</a> of file <a class="el" href="RoleBase_8php_source.html">RoleBase.php</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>lib/Drush/Role/<a class="el" href="RoleBase_8php_source.html">RoleBase.php</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Nov 2 2016 07:30:17 for Drush by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.1.2
</small></address>
</body>
</html>