|
| init () |
|
| checkPermission ($gperm_name, $gperm_itemid, $trueifadmin=true) |
|
| getItemIds ($gperm_name, $gperm_groupid) |
|
| checkPermissionRedirect ( $gperm_name, $gperm_itemid, $url, $time=3, $message='', $trueifadmin=true) |
|
| getGroupsForItem ($gperm_name, $gperm_itemid) |
|
| savePermissionForItem ($gperm_name, $gperm_itemid, $groups) |
|
| deletePermissionForItem ($gperm_name, $gperm_itemid) |
|
| getGroupSelectFormForItem ( $gperm_name, $gperm_itemid, $caption, $name=null, $include_anon=false, $size=5, $multiple=true) |
|
| defaultFieldName ($gperm_name, $gperm_itemid) |
|
| __construct ($dirname=null) |
|
| init () |
|
| dirname () |
|
| setDebug ($bool=true) |
|
| addLog ($log) |
|
◆ checkPermission()
checkPermission |
( |
|
$gperm_name, |
|
|
|
$gperm_itemid, |
|
|
|
$trueifadmin = true |
|
) |
| |
Check if the user has permission for an item
- Parameters
-
string | $gperm_name | name of the permission to test |
int | $gperm_itemid | id of the object to check |
bool | $trueifadmin | true to always return true for admin groups |
- Returns
- bool true if user has access, false if not
◆ checkPermissionRedirect()
checkPermissionRedirect |
( |
|
$gperm_name, |
|
|
|
$gperm_itemid, |
|
|
|
$url, |
|
|
|
$time = 3 , |
|
|
|
$message = '' , |
|
|
|
$trueifadmin = true |
|
) |
| |
Redirect to a url if user does not have permission for an item
- Parameters
-
string | $gperm_name | name of the permission to test |
int | $gperm_itemid | id of the object to check |
string | $url | module relative url to redirect to |
int | $time | time in seconds to delay |
string | $message | message to display with redirect |
bool | $trueifadmin | true to always return true for admin groups |
- Returns
- void
◆ defaultFieldName()
defaultFieldName |
( |
|
$gperm_name, |
|
|
|
$gperm_itemid |
|
) |
| |
Generate a default name for a XoopsFormElement based on module, gperm_name and gperm_itemid
- Parameters
-
string | $gperm_name | name of the permission to test |
int | $gperm_itemid | id of the object to check |
- Returns
- string
◆ deletePermissionForItem()
deletePermissionForItem |
( |
|
$gperm_name, |
|
|
|
$gperm_itemid |
|
) |
| |
Delete all permissions for an item and a specific name or array of names
- Parameters
-
string | string[] | $gperm_name | name(s) of the permission to delete |
int | $gperm_itemid | id of the object to check |
- Returns
- bool true if no errors
◆ getGroupSelectFormForItem()
getGroupSelectFormForItem |
( |
|
$gperm_name, |
|
|
|
$gperm_itemid, |
|
|
|
$caption, |
|
|
|
$name = null , |
|
|
|
$include_anon = false , |
|
|
|
$size = 5 , |
|
|
|
$multiple = true |
|
) |
| |
Generate a XoopsFormElement to select groups to grant permission to a specific gperm_name and gperm_item. Field will be preset with existing permissions.
- Parameters
-
string | $gperm_name | name of the permission to test |
int | $gperm_itemid | id of the object to check |
string | $caption | caption for form field |
string | $name | name/id of form field |
bool | $include_anon | true to include anonymous group |
int | $size | size of list |
bool | $multiple | true to allow multiple selections |
- Returns
- object XoopsFormSelectGroup
◆ getGroupsForItem()
getGroupsForItem |
( |
|
$gperm_name, |
|
|
|
$gperm_itemid |
|
) |
| |
Get array of groups with named permission to an item
- Parameters
-
string | $gperm_name | name of the permission to test |
int | $gperm_itemid | id of the object to check |
- Returns
- array groups with permission for item
◆ getItemIds()
getItemIds |
( |
|
$gperm_name, |
|
|
|
$gperm_groupid |
|
) |
| |
Get all item IDs for which a group (or set of groups) has a specific permission Return an array of items for which the specified groups have the named permission
- Parameters
-
string | $gperm_name | Name of permission |
int | array | $gperm_groupid | A group ID or an array of group IDs |
- Returns
- array array of item IDs
◆ getUserGroups()
Get any groups associated with the current user
- Returns
- int|int[] group id(s)
◆ init()
Initialize parent::__construct calls this after verifying module object.
- Returns
- void
Reimplemented from AbstractHelper.
◆ savePermissionForItem()
savePermissionForItem |
( |
|
$gperm_name, |
|
|
|
$gperm_itemid, |
|
|
|
$groups |
|
) |
| |
Save group permissions for an item
- Parameters
-
string | $gperm_name | name of the permission to test |
int | $gperm_itemid | id of the object to check |
array | $groups | group ids to grant permission to |
- Returns
- bool true if no errors
◆ $dirname
◆ $mid
◆ $permissionHandler
The documentation for this class was generated from the following file:
- C:/xoops2511b2/htdocs/class/libraries/vendor/xoops/xmf/src/Module/Helper/Permission.php