BEdita API doc | 4-cactus
  • Class
  • Tree
  • Deprecated
  • Download

Classes

  • Addon
  • AddressbookController
  • AddressbookShell
  • AdminController
  • Alias
  • Annotation
  • ApiAuthComponent
  • ApiBaseController
  • ApiFormatterComponent
  • ApiUploadComponent
  • ApiValidatorComponent
  • AppController
  • AppError
  • AppHelper
  • Application
  • AppModel
  • Area
  • AreasController
  • Audio
  • AuthenticationsController
  • BannedIp
  • BEAppModel
  • BEAppObjectModel
  • BeAuthComponent
  • BeAuthFacebookComponent
  • BeAuthGoogleComponent
  • BeAuthTwitterComponent
  • BeCallbackManager
  • BeConfigure
  • BeCustomPropertyComponent
  • BeditaAnnotationModel
  • BeditaBaseShell
  • BeditaCollectionModel
  • BeditaContentModel
  • BeditaExportFilter
  • BeditaImportFilter
  • BeditaObjectModel
  • BeditaProductModel
  • BeditaShell
  • BeditaSimpleObjectModel
  • BeditaSimpleStreamModel
  • BeditaStreamModel
  • BeEmbedFlashHelper
  • BeEmbedHtml5Helper
  • BeEmbedMediaHelper
  • BeErrorCode
  • BeExceptionHandler
  • BEFile
  • BeFileHandlerComponent
  • BeFormHelper
  • BeFrontHelper
  • BeHashComponent
  • BeHtmlHelper
  • BeLangTextComponent
  • BeLib
  • BeMailComponent
  • BEObject
  • BeObjectCache
  • BePaginatorToolbarHelper
  • BeSchema
  • BeSecurityComponent
  • BeSystem
  • BeSystemComponent
  • BeThumb
  • BeTimeHelper
  • BeToolbarHelper
  • BeTreeComponent
  • BeTreeHelper
  • BeUploadToObjComponent
  • BeurlHelper
  • BeVimeoComponent
  • BeYoutubeComponent
  • BuildFilterBehavior
  • CacheableBehavior
  • CacheShell
  • CallbackBehavior
  • CaptchaComponent
  • Caption
  • CaptionsBehavior
  • Card
  • CardsImportFilter
  • Category
  • CleanupDataTask
  • CleanupTask
  • Comment
  • CommentsController
  • CompactResultBehavior
  • Content
  • CreateIndexFieldsBehavior
  • DataShell
  • DataTransfer
  • DateItem
  • DbadminShell
  • DeleteDependentObjectBehavior
  • DeleteObjectBehavior
  • DeployShell
  • Document
  • DocumentsController
  • DumpModel
  • EditorialContentsShell
  • EditorNote
  • Event
  • EventLog
  • EventsController
  • FilesController
  • ForeignDependenceSaveBehavior
  • FrontendController
  • FrontendShell
  • GalleriesController
  • Gallery
  • GeoTag
  • GettextShell
  • Git
  • GravatarHelper
  • Group
  • HashJob
  • History
  • HomeController
  • Image
  • ImageInfoHelper
  • JsonExportFilter
  • JsonImportFilter
  • JsonView
  • LangText
  • Link
  • MailGroup
  • MailGroupCard
  • MailJob
  • MailLog
  • MailMessage
  • MailShell
  • MailTemplate
  • Mask
  • MediaShell
  • MigrateDumpModel
  • MigrateShell
  • Migration
  • MigrationBase
  • MigrationDateItemsShell
  • Module
  • ModulesController
  • ModuleShell
  • MultimediaController
  • NewsController
  • NewsletterController
  • NewsletterShell
  • NotifyBehavior
  • ObjectEditor
  • ObjectProperty
  • ObjectRelation
  • ObjectType
  • ObjectUser
  • PagesController
  • Permission
  • PermissionModule
  • PermsHelper
  • Product
  • Property
  • PropertyOption
  • PublicationShell
  • RedisShell
  • RelationCheck
  • RelationRepair
  • RelationShell
  • RelationStats
  • RemoveDummyNameBehavior
  • ResponseHandlerComponent
  • RestClientModel
  • Revision
  • RevisionObjectBehavior
  • SearchText
  • SearchTextSaveBehavior
  • Section
  • SectionDummy
  • SessionFilterComponent
  • SessionFilterHelper
  • ShortNews
  • SmartyView
  • SoapClientModel
  • SplitterSql
  • StatisticsController
  • Stream
  • StreamLog
  • StreamsController
  • Svn
  • TagsController
  • ThemeSmartyView
  • ThumbnailHelper
  • ThumbShell
  • TransactionComponent
  • TransactionFS
  • TranslationsController
  • Tree
  • TrHelper
  • User
  • UserProperty
  • UsersController
  • Utility
  • Version
  • Video
  • VimeoHelper
  • WebmarksController
  • XmlExportFilter
  • XmlImportFilter
  • XmlJsonConverter
  • XmlView
  • YoutubeHelper

Interfaces

  • ApiAuthInterface
  • MediaProviderInterface
  • UploadableInterface

Exceptions

  • BeditaAjaxException
  • BEditaAllowURLException
  • BeditaBadRequestException
  • BeditaConflictException
  • BEditaDeleteStreamObjException
  • BeditaException
  • BEditaFileExistException
  • BeditaForbiddenException
  • BeditaFrontAccessException
  • BeditaHashException
  • BEditaInfoException
  • BeditaInternalErrorException
  • BEditaIOException
  • BeditaLengthRequiredException
  • BeditaMailException
  • BEditaMediaProviderException
  • BeditaMethodNotAllowedException
  • BEditaMIMEException
  • BeditaNotFoundException
  • BeditaNotImplementedException
  • BeditaPublicationException
  • BeditaRuntimeException
  • BEditaSaveStreamObjException
  • BeditaServiceUnavailableException
  • BeditaUnauthorizedException
  • BEditaUploadPHPException
  • BEditaURLException

Class Permission

Model
Extended by AppModel
Extended by BEAppModel
Extended by Permission
Version: $Revision$
Modifiedby: $LastChangedBy$
Lastmodified:

$LastChangedDate$

$Id$


Located at models/account/permission.php

Methods summary

public
# __construct( )
public
# add( integer $objectId, array $perms )

Add object permissions

Add object permissions

Parameters

$objectId
$objId object id
$perms
array like (array("flag"=>1, "switch" => "group", "name" => "guest"), array(...))
public
# removeAll( integer $objectId )

Remove all object permissions.

Remove all object permissions.

Parameters

$objectId
object ID
public
# replace( integer $objectId, array $perms )

Updates/replaces object permissions

Updates/replaces object permissions

Parameters

$objectId
$objId object id
$perms
array like (array("flag"=>1, "switch" => "group", "name" => "guest"), array(...))
public
# replaceGroupPerms( integer $groupId, array $perms )

remove old permissions on $groupId and add new $perms

remove old permissions on $groupId and add new $perms

Parameters

$groupId
$perms
array like (array("flag"=> 1, "object_id"), array(...))
public boolean,
# isWritable( integer $objectId, array & $userData, $perms = array() )

Is object ($objectId) writable by user?

Is object ($objectId) writable by user?

Parameters

$objectId
$userData
user data, like array("id" => .., "userid" => ..., "groups" => array("administrator", "frontend",...))
$perms

array defined like in checkPermissionByUser() call if it's defined use it else get permission by $objectId

Returns

boolean,
true if it's writable
public boolean,
# isForbidden( integer $objectId, array & $userData )

Is object ($objectId) forbidden to user? Backend only (check backend_private permission)

Is object ($objectId) forbidden to user? Backend only (check backend_private permission)

Parameters

$objectId
$userData
user data, like array("id" => .., "userid" => ..., "groups" => array("administrator", "frontend",...))

Returns

boolean,
true if it's forbidden false if it's allowed
public boolean,
# isAccessibleByFrontend( $objectId, array & $userData, $perms = array() )

Is object ($objectId) accessible by user in frontend?

Is object ($objectId) accessible by user in frontend?

Parameters

$objectId
$userData
data, like array("id" => .., "userid" => ..., "groups" => array("administrator", "frontend",...))
$perms

array defined like in checkPermissionByUser() call if it's defined use it else get permission by $objectId

Returns

boolean,
true if it's accessible
public string
# frontendAccess( integer $objectId, array & $userData = array() )

Return frontend level access to an object

Return frontend level access to an object

Possible returned values are:

  • 'free' if the object has not frontend_access perms
  • 'denied' if the object isn't accessible (frontend_access_with_block perms set and user groups haven't that permission on that object)
  • 'partial' if the object is accessible in preview (frontend_access_without_block perms set and user groups haven't that permission on that object)
  • 'full' if the object has perms and user groups have that permission on that object

Parameters

$objectId
$userData

$userData user data as array( 'id' => .., 'userid' => ..., 'groups' => array('administrator', 'frontend',...) )

Returns

string
public boolean
# checkPermissionByUser( $perms, array & $userData )

check if user or user groups are in $perms array

check if user or user groups are in $perms array

Parameters

$perms

array like return from find("all) array( 0 => array("Permission" => array(...), "User" => array(...), "Group" => array(...)), 1 => .... )

$userData
data, like array("id" => .., "userid" => ..., "groups" => array("administrator", "frontend",...))

Returns

boolean
(true if user have permission false otherwise)
public array
# isPermissionSet( integer $objectId, array|integer $flag )

check if a permission over an object is set

check if a permission over an object is set

Parameters

$objectId
$flag
permission

Returns

array
of perms with users and groups or false if no permission is setted
public
# remove( integer $objectId, array $perms )

Delete a permit for an object

Delete a permit for an object

Parameters

$objectId
$id object ID
$perms
array like (array("flag"=>1, "switch" => "group", "name" => "guest"), array(...))
public array
# load( integer $objectId, mixed $flag = array() )

Load all object permissions, using object cache, selecting one or more flag value

Load all object permissions, using object cache, selecting one or more flag value

Parameters

$objectId
$flag
array or string with flag permission to search

Returns

array
(permissions)
private
# cleanupPermissionData( array & $perms )
public array
# countPermissions( array $objects, array $options )

passed an array of BEdita objects add 'count_permission' key with the number of permissions applied to objects

passed an array of BEdita objects add 'count_permission' key with the number of permissions applied to objects

Parameters

$objects
$options
  • flag: if specified count permission with that flag

Returns

array
$objects with added 'count_permission' key
public array
# relatedObjectsNotAccessibile( integer $objectId, array $options = array(), array $user = array() )

Return information about frontend not accessible related objects to $objectId

Return information about frontend not accessible related objects to $objectId

If $options['count'] = false (default) it returns a list of object ids with permission 'frontend_access_with_block' related to main object $objectId. Passing also $options['relation'] it filters by relation name

If $options['count'] = true it returns an array of count of objects with permission 'frontend_access_with_block' related to main object $objectId and grouped by relation name

Example:

array(
    'attach' => 14,
    'seealso' => 7
)

If $user['groups'] is specified then it tests related objects against user groups and return a list without objects allowed to user or a count of objects not allowed to user

Parameters

$objectId
the main object id
$options
$relation the relation name
$user
the user data on which check perms

Returns

array
public boolean
# isObjectsAndParentsAccessible( integer $objectId, array $options = array(), array $user = array() )

Return true if object $objectId and its parents are accessible i.e. for $user 'Accessible' means without 'frontend_access_with_block' permission set

Return true if object $objectId and its parents are accessible i.e. for $user 'Accessible' means without 'frontend_access_with_block' permission set

$options params are: - 'status' the status of parents to check - 'area_id' the parents publication id - 'stopIfMissingParents' true (default) to stop and return not valid if $objectId haven't parents and it isn't a publication

Parameters

$objectId
the object id
$options
$user
the user data

Returns

boolean
public boolean
# objectParentsAccessible( integer $objectId, array $options = array(), array $userGroups = array() )

Return true if object $objectId parents are accessible for a user 'Accessible' means without 'frontend_access_with_block' permission set

Return true if object $objectId parents are accessible for a user 'Accessible' means without 'frontend_access_with_block' permission set

$options params are:

  • 'status' the status of parents to check
  • 'area_id' the parents publication id
  • 'stopIfMissingParents' true (default) to stop and return not valid if $objectId haven't parents and it isn't a publication

Parameters

$objectId
the object id
$options
$userGroups
array of user groups ids

Returns

boolean

Methods inherited from BEAppModel

am(), buildQueryStatement(), checkDate(), checkDuration(), checkFloat(), checkNumber(), containLevel(), email(), fieldsString(), findObjects(), findObjectsAfterFilter(), findObjectsClauses(), findObjectsCount(), getBindingsLevel(), getDefaultDateFormat(), getDriver(), getEndQuote(), getLimitClausole(), getStartQuote(), setBindingsLevel(), setupDbParams(), toolbar()

Methods inherited from AppModel

apiTransformer()

Properties summary

public array $belongsTo
# array( 'User' => array( 'className' => 'User', 'conditions' => "Permission.switch = 'user' ", 'foreignKey' => 'ugid' ), 'Group' => array( 'className' => 'Group', 'conditions' => "Permission.switch = 'group' ", 'foreignKey' => 'ugid' ), )
protected $BeObjectCache

Object cache

Object cache

# null

Properties inherited from BEAppModel

$actsAs, $driver, $eQ, $modelBindings, $sQ

Properties inherited from AppModel

$apiTransformerOptions

BEdita API doc | 4-cactus API documentation generated by ApiGen