Overview

Namespaces

  • None
  • Xmf
    • Database
    • Module
      • Helper
    • Template
  • Xoops
    • Auth
    • Core
      • Cache
      • Database
        • Logging
        • Schema
      • Exception
      • Handler
        • Scheme
      • Kernel
        • Dtype
        • Handlers
        • Model
      • Lists
      • Locale
        • Punic
      • Service
        • Contract
      • Session
      • Text
        • Sanitizer
          • Extensions
      • Theme
        • Plugins
    • Form
    • Html
    • Locale
    • Module
      • Helper
      • Plugin

Classes

  • Admin
  • Cache
  • Helper
  • Permission
  • Session
  • Overview
  • Namespace
  • Class
  • Tree

Class Permission

Methods to help manage permissions within a module

Xmf\Module\Helper\AbstractHelper
Extended by Xmf\Module\Permission
Namespace: Xmf\Module
Package: Xmf
Category: Xmf\Module\Helper\Permission
Copyright: 2011-2015 XOOPS Project (http://xoops.org)
License: GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
Author: trabis lusopoemas@gmail.com
Author: Richard Griffith richard@geekwright.com
Version: Release: 1.0
Since: 1.0
Link: http://xoops.org
Located at oops_lib/Xmf/Module/Permission.php
Methods summary
public
# init( )

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

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

public boolean
# checkPermission( string $gperm_name, integer $gperm_itemid )

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

Returns

boolean
true if user has access, false if not
public
# checkPermissionRedirect( string $gperm_name, integer $gperm_itemid, string $url, integer $time = 3, string $message = '' )

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
public array
# getGroupsForItem( string $gperm_name, integer $gperm_itemid )

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

array
groups with permission for item
public boolean
# savePermissionForItem( string $gperm_name, integer $gperm_itemid, array $groups )

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

boolean
true if no errors
public boolean
# deletePermissionForItem( string $gperm_name, integer $gperm_itemid )

Delete all permissions for a specific name and item

Delete all permissions for a specific name and item

Parameters

$gperm_name
name of the permission to test
$gperm_itemid
id of the object to check

Returns

boolean
true if no errors
public Xoops\Form\SelectGroup
# getGroupSelectFormForItem( string $gperm_name, integer $gperm_itemid, string $caption, string $name = null, boolean $include_anon = false, integer $size = 5, boolean $multiple = true )

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

Generate a \Xoops\Form\Element 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

Xoops\Form\SelectGroup
public string
# defaultFieldName( string $gperm_name, integer $gperm_itemid )

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

Generate a default name for a Xoops\Form\SelectGroup 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

Returns

string
Methods inherited from Xmf\Module\Helper\AbstractHelper
__construct(), addLog(), setDebug()
Properties inherited from Xmf\Module\Helper\AbstractHelper
$debug, $module
API documentation generated by ApiGen