Admidio API
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Packages

  • com
    • tecnick
      • tcpdf
  • None
  • PHPMailer
    • easypeasyics
  • PHPWavUtils
  • Securimage
    • classes

Classes

  • AutoLogin
  • Component
  • ComponentUpdate
  • ConditionParser
  • Database
  • DateTimeExtended
  • Email
  • Folder
  • FormValidation
  • FunctionClass
  • Htaccess
  • HtmlDiv
  • HtmlElement
  • HtmlForm
  • HtmlFormBasic
  • HtmlFormInstallation
  • HtmlList
  • HtmlNavbar
  • HtmlPage
  • HtmlTable
  • HtmlTableBasic
  • Image
  • Inventory
  • InventoryFields
  • Language
  • LanguageData
  • ListConfiguration
  • Menu
  • Message
  • ModuleAnnouncements
  • ModuleDates
  • ModuleLists
  • ModuleMenu
  • ModuleMessages
  • Modules
  • ModuleWeblinks
  • MyFiles
  • Navigation
  • ntlm_sasl_client_class
  • Organization
  • Participants
  • PasswordHash
  • PasswordHashing
  • ProfileFields
  • RoleDependency
  • RolesRights
  • RSSfeed
  • Session
  • SystemMail
  • TableAccess
  • TableAnnouncement
  • TableCategory
  • TableDate
  • TableFile
  • TableFolder
  • TableGuestbook
  • TableGuestbookComment
  • TableInventory
  • TableInventoryField
  • TableLists
  • TableMembers
  • TableMessage
  • TablePhotos
  • TableRoles
  • TableRooms
  • TableText
  • TableUserField
  • TableUsers
  • TableWeblink
  • UploadHandlerDownload
  • UploadHandlerPhoto
  • User
  • UserRegistration

Exceptions

  • AdmException
  • WavFileException
  • WavFormatException

Functions

  • admFuncAutoload
  • admFuncGeneratePagination
  • admFuncGetBytesFromSize
  • admFuncGetDirectoryEntries
  • admFuncMaxUploadSize
  • admFuncProcessableImageSize
  • admFuncShowCreateChangeInfoById
  • admFuncShowCreateChangeInfoByName
  • admFuncVariableIsValid
  • admReadTemplateFile
  • admStrIsValidFileName
  • admStrStripTagsSpecial
  • admStrToLower
  • admStrToUpper
  • bzip2Version
  • checkDatabaseVersion
  • checkPhpVersion
  • EmailAttachment
  • FileSizeNiceDisplay
  • FormattedTimeRemaining
  • FunctionIsDisabled
  • getFormerRolesFromDatabase
  • getFutureRolesFromDatabase
  • getmicrotime
  • getRoleMemberships
  • getRolesFromDatabase
  • gzipVersion
  • hasRole
  • hl_attrval
  • hl_bal
  • hl_cmtcd
  • hl_ent
  • hl_prot
  • hl_regex
  • hl_spec
  • hl_tag
  • hl_tag2
  • hl_tidy
  • hl_version
  • htmLawed
  • HTMLFilter
  • isGroupLeader
  • isMember
  • kses
  • kses_hook
  • MySQLdumpVersion
  • OutputInformation
  • SafeExec
  • showNotice
  • strAddSlashesDeep
  • strNextLetter
  • strStripSlashesDeep
  • strStripTags
  • strValidCharacters
  • tln_body2div
  • tln_casenormalize
  • tln_deent
  • tln_defang
  • tln_findnxreg
  • tln_findnxstr
  • tln_fixatts
  • tln_fixstyle
  • tln_fixurl
  • tln_getnxtag
  • tln_sanitize
  • tln_skipspace
  • tln_tagprint
  • tln_unspace
  • version_compare_replacement
  • version_compare_replacement_sub

Class RolesRights

TableAccess
Extended by RolesRights
Copyright: 2004-2016 The Admidio Team
License: GNU General Public License v2.0 only **********************************************************************************************
Brief:

Manages a special right of the table adm_roles_rights for a special object.

This class will manage roles rights for a specific object. The possible rights are defined within the table adm_roles_rights. The assigned roles will be stored within the table adm_roles_rights_data. There is also the link to the specific object. The assigned roles of the object could be managed with this class. You can add or remove roles and check if a user has access to the specific right.


Class: RolesRights
Code:

// check if the current user has the right to view a folder of the download module $folderViewRolesObject = new RolesRights($gDb, 'folder_view', $folderId); if($folderViewRolesObject->hasRight($gCurrentUser->getRoleMemberships())) { // do something } @endcode


Code:

// add new roles to the special roles right of a folder $folderViewRolesObject = new RolesRights($gDb, 'folder_view', $folderId); $folderViewRolesObject->addRoles(array(2, 5)); @endcode


Par: Examples
Located at rolesrights.php

Methods summary

public
# __construct( Database & $database, string $rolesRightName, string $objectId )

Constructor that will create an object of a recordset of the table adm_roles_rights. If the id is set than the specific category will be loaded.

Constructor that will create an object of a recordset of the table adm_roles_rights. If the id is set than the specific category will be loaded.

Parameters

$database
Object of the class Database. This should be the default global object @b $gDb.
$rolesRightName
The recordset of the roles right with this name will be loaded.
$objectId
Id of the object of which the roles should be loaded.

Overrides

TableAccess::__construct
public
# addRoles( array $roleIds )

Add all roles of the parameter array to the current roles rights object.

Add all roles of the parameter array to the current roles rights object.

Parameters

$roleIds
Array with all role ids that should be add.
public boolean
# hasRight( array $assignedRoles )

Check if one of the assigned roles is also a role of the current object. Method will return true if at least one role was found.

Check if one of the assigned roles is also a role of the current object. Method will return true if at least one role was found.

Parameters

$assignedRoles
Array with all assigned roles of the user whose rights should be checked

Returns

boolean
Return @b true if at least one role of the assigned roles exists at the current object.
public
# clear( )

Initializes all class parameters and deletes all read data.

Initializes all class parameters and deletes all read data.

Overrides

TableAccess::clear
public boolean
# delete( )

Deletes all assigned roles to the current object. After that the class will be initialize.

Deletes all assigned roles to the current object. After that the class will be initialize.

Returns

boolean
@b true if no error occurred

Overrides

TableAccess::delete
public int[]
# getRolesIds( )

Get all roles ids that where assigned to the current roles right and the selected object.

Get all roles ids that where assigned to the current roles right and the selected object.

Returns

int[]
Returns an array with all role ids
protected boolean
# readData( string $sqlWhereCondition )

Reads a record out of the table in database selected by the conditions of the param @b $sqlWhereCondition out of the table. If the sql will find more than one record the method returns @b false. Per default all columns of the default table will be read and stored in the object.

Reads a record out of the table in database selected by the conditions of the param @b $sqlWhereCondition out of the table. If the sql will find more than one record the method returns @b false. Per default all columns of the default table will be read and stored in the object.

Parameters

$sqlWhereCondition
Conditions for the table to select one record

Returns

boolean
Returns @b true if one record is found

See

TableAccess#readDataById
TableAccess#readDataByColumns

Overrides

TableAccess::readData
public
# removeRoles( array $roleIds )

Remove all roles of the parameter array from the current roles rights object.

Remove all roles of the parameter array from the current roles rights object.

Parameters

$roleIds
Array with all role ids that should be removed.

Methods inherited from TableAccess

__sleep(), connectAdditionalTable(), countAllRecords(), getValue(), hasColumnsValueChanged(), isNewRecord(), readDataByColumns(), readDataById(), save(), setArray(), setDatabase(), setValue()

Properties summary

protected $rolesRightsDataObjects
#
protected $rolesIds
#
protected $objectId
#
protected $rolesRightName
#

Properties inherited from TableAccess

$additionalTables, $columnPrefix, $columnsInfos, $columnsValueChanged, $db, $dbColumns, $keyColumnName, $new_record, $tableName

Admidio API API documentation generated by ApiGen