XOOPS  2.6.0
Xmf\Module\Permission Class Reference
Inheritance diagram for Xmf\Module\Permission:
Inheritance graph

Public Member Functions

 checkPermission ($gperm_name, $gperm_itemid)
 
 checkPermissionRedirect ($gperm_name, $gperm_itemid, $url, $time=3, $message= '')
 
 defaultFieldName ($gperm_name, $gperm_itemid)
 
 deletePermissionForItem ($gperm_name, $gperm_itemid)
 
 getGroupSelectFormForItem ($gperm_name, $gperm_itemid, $caption, $name=null, $include_anon=false, $size=5, $multiple=true)
 
 getGroupsForItem ($gperm_name, $gperm_itemid)
 
 init ()
 
 savePermissionForItem ($gperm_name, $gperm_itemid, $groups)
 
- Public Member Functions inherited from Xmf\Module\Helper\AbstractHelper
 __construct ($module=null)
 
 addLog ($log)
 
 init ()
 
 setDebug ($bool=true)
 

Private Attributes

 $db
 
 $dirname
 
 $mid
 
 $perm
 
 $xoops = null
 

Additional Inherited Members

- Protected Attributes inherited from Xmf\Module\Helper\AbstractHelper
 $debug
 
 $module
 

Detailed Description

Definition at line 31 of file Permission.php.

Member Function Documentation

Xmf\Module\Permission::checkPermission (   $gperm_name,
  $gperm_itemid 
)

Check if the user has permission for an item

Parameters
string$gperm_namename of the permission to test
int$gperm_itemidid of the object to check
Returns
bool true if user has access, false if not

Definition at line 85 of file Permission.php.

Xmf\Module\Permission::checkPermissionRedirect (   $gperm_name,
  $gperm_itemid,
  $url,
  $time = 3,
  $message = '' 
)

Redirect to a url if user does not have permission for an item

Parameters
string$gperm_namename of the permission to test
int$gperm_itemidid of the object to check
string$urlmodule relative url to redirect to
int$timetime in seconds to delay
string$messagemessage to display with redirect
Returns
void

Definition at line 108 of file Permission.php.

References $helper, $url, and Xmf\Module\Helper\getHelper().

Here is the call graph for this function:

Xmf\Module\Permission::defaultFieldName (   $gperm_name,
  $gperm_itemid 
)

Generate a default name for a Xoops based on module, gperm_name and gperm_itemid

Parameters
string$gperm_namename of the permission to test
int$gperm_itemidid of the object to check
Returns
string

Definition at line 235 of file Permission.php.

References $name.

Referenced by Xmf\Module\Permission\getGroupSelectFormForItem().

Here is the caller graph for this function:

Xmf\Module\Permission::deletePermissionForItem (   $gperm_name,
  $gperm_itemid 
)

Delete all permissions for a specific name and item

Parameters
string$gperm_namename of the permission to test
int$gperm_itemidid of the object to check
Returns
bool true if no errors

Definition at line 180 of file Permission.php.

Referenced by Xmf\Module\Permission\savePermissionForItem().

Here is the caller graph for this function:

Xmf\Module\Permission::getGroupSelectFormForItem (   $gperm_name,
  $gperm_itemid,
  $caption,
  $name = null,
  $include_anon = false,
  $size = 5,
  $multiple = true 
)

Generate a to select groups to grant permission to a specific gperm_name and gperm_item. Field will be preset with existing permissions.

Parameters
string$gperm_namename of the permission to test
int$gperm_itemidid of the object to check
string$captioncaption for form field
string$namename/id of form field
bool$include_anontrue to include annonymous group
int$sizesize of list
bool$multipletrue to allow multiple selections
Returns

Definition at line 200 of file Permission.php.

References $name, Xmf\Module\Permission\defaultFieldName(), and Xmf\Module\Permission\getGroupsForItem().

Here is the call graph for this function:

Xmf\Module\Permission::getGroupsForItem (   $gperm_name,
  $gperm_itemid 
)

Get array of groups with named permission to an item

Parameters
string$gperm_namename of the permission to test
int$gperm_itemidid of the object to check
Returns
array groups with permission for item

Definition at line 136 of file Permission.php.

Referenced by Xmf\Module\Permission\getGroupSelectFormForItem().

Here is the caller graph for this function:

Xmf\Module\Permission::init ( )

Initialize parent::__constuct calls this after verifying module object.

Returns
void

Definition at line 63 of file Permission.php.

References XoopsBaseConfig\get(), Xoops\Core\Database\Factory\getConnection(), Xoops\getInstance(), and Xmf\Loader\loadFile().

Here is the call graph for this function:

Xmf\Module\Permission::savePermissionForItem (   $gperm_name,
  $gperm_itemid,
  $groups 
)

Save group permissions for an item

Parameters
string$gperm_namename of the permission to test
int$gperm_itemidid of the object to check
array$groupsgroup ids to grant permission to
Returns
bool true if no errors

Definition at line 150 of file Permission.php.

References $groups, $result, and Xmf\Module\Permission\deletePermissionForItem().

Here is the call graph for this function:

Member Data Documentation

Xmf\Module\Permission::$db
private

Definition at line 46 of file Permission.php.

Xmf\Module\Permission::$dirname
private

Definition at line 41 of file Permission.php.

Xmf\Module\Permission::$mid
private

Definition at line 36 of file Permission.php.

Xmf\Module\Permission::$perm
private

Definition at line 51 of file Permission.php.

Xmf\Module\Permission::$xoops = null
private

Definition at line 56 of file Permission.php.


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