Methods |
public
|
init(): void
Initialize parent::__construct calls this after verifying module object.
Initialize parent::__construct calls this after verifying module object.
Implements
|
#
|
public
|
checkPermission(string $gperm_name, int $gperm_itemid, bool $trueifadmin = true): bool
Check if the user has permission for an item
Check if the user has permission for an item
Parameters
$gperm_name |
name of the permission to test
|
$gperm_itemid |
id of the object to check
|
$trueifadmin |
true to always return true for admin groups
|
Returns
true if user has access, false if not
|
#
|
public
|
getItemIds(string $gperm_name, int|array $gperm_groupid): array
Get all item IDs for which a group (or set of groups) has a specific permission
Return an array of items for which the…
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
$gperm_name |
Name of permission
|
$gperm_groupid |
A group ID or an array of group IDs
|
Returns
|
#
|
public
|
checkPermissionRedirect(
string $gperm_name,
int $gperm_itemid,
string $url,
int $time = 3,
string $message = '',
bool $trueifadmin = true,
): void
Redirect to a URL if user does not have permission for an item
Redirect to a URL if user does not have permission for an item
Parameters
$gperm_name |
name of the permission to test
|
$gperm_itemid |
id of the object to check
|
$url |
module relative url to redirect to
|
$time |
time in seconds to delay
|
$message |
message to display with redirect
|
$trueifadmin |
true to always return true for admin groups
|
|
#
|
public
|
getGroupsForItem(string $gperm_name, int $gperm_itemid): array
Get array of groups with named permission to an item
Get array of groups with named permission to an item
Parameters
$gperm_name |
name of the permission to test
|
$gperm_itemid |
id of the object to check
|
Returns
groups with permission for item
|
#
|
public
|
savePermissionForItem(string $gperm_name, int $gperm_itemid, array $groups): bool
Save group permissions for an item
Save group permissions for an item
Parameters
$gperm_name |
name of the permission to test
|
$gperm_itemid |
id of the object to check
|
$groups |
group ids to grant permission to
|
Returns
|
#
|
public
|
deletePermissionForItem(string|string[] $gperm_name, int $gperm_itemid): bool
Delete all permissions for an item and a specific name or array of names
Delete all permissions for an item and a specific name or array of names
Parameters
$gperm_name |
name(s) of the permission to delete
|
$gperm_itemid |
id of the object to check
|
Returns
|
#
|
public
|
getGroupSelectFormForItem(
string $gperm_name,
int $gperm_itemid,
string $caption,
string $name = null,
bool $include_anon = false,
int $size = 5,
bool $multiple = true,
): object
Generate a XoopsFormElement to select groups to grant permission
to a specific gperm_name and gperm_item. Field will be…
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
$gperm_name |
name of the permission to test
|
$gperm_itemid |
id of the object to check
|
$caption |
caption for form field
|
$name |
name/id of form field
|
$include_anon |
true to include anonymous group
|
$size |
size of list
|
$multiple |
true to allow multiple selections
|
Returns
|
#
|
public
|
defaultFieldName(string $gperm_name, int $gperm_itemid): string
Generate a default name for a XoopsFormElement based on
module, gperm_name and gperm_itemid
Generate a default name for a XoopsFormElement based on
module, gperm_name and gperm_itemid
Parameters
$gperm_name |
name of the permission to test
|
$gperm_itemid |
id of the object to check
|
|
#
|
protected
|
getUserGroups(): int|int[]
Get any groups associated with the current user
Get any groups associated with the current user
Returns
|
#
|