Overview

Packages

  • akismet
  • None
  • PHP
  • Smarty
    • Cacher
    • Compiler
    • Config
    • Debug
    • plugins
    • PluginsBlock
    • PluginsFilter
    • PluginsFunction
    • PluginsInternal
    • PluginsModifier
    • PluginsModifierCompiler
    • PluginsShared
    • Security
    • Template
    • TemplateResources
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Signatures
    • Signed
    • Transport
  • wa-apps
    • blog
      • actions
        • backend
        • blog
        • comment
        • cron
        • design
        • frontend
        • page
        • plugin
        • post
      • api
        • v1
      • cli
      • layout
      • model
      • plugin
        • aksimet
        • category
        • emailsubscription
        • favorite
        • gravatar
        • import
        • markdown
        • myposts
        • tag
        • troll
      • settings
    • checklists
      • backend
      • json
    • contacts
      • backend
    • developer
    • dummy
    • guestbook
    • guestbook2
    • photos
      • album
      • api
        • v1
      • backend
      • design
      • dialog
      • frontend
      • page
      • photo
      • plugin
        • comment
        • imageeffects
        • import
        • publicgallery
        • watermark
      • search
      • settings
      • stack
      • tag
      • upload
    • site
      • backend
      • blocks
      • config
      • design
      • domains
      • files
      • frontend
      • helper
      • layout
      • pages
      • routing
      • setting
    • stickies
      • api
        • v1
      • sheet
      • stiky
  • wa-plugin
    • payment
    • shipping
    • sms
  • wa-plugins
    • shipping
      • usps
  • wa-system
    • API
    • Auth
      • Adapters
    • Autoload
    • Cache
      • Adapter
    • Captcha
    • Config
    • Contact
    • controller
    • currency
    • database
    • datetime
    • design
    • event
    • exception
    • files
    • image
    • layout
    • locale
    • log
    • mail
    • page
      • action
      • model
    • payment
    • plugin
    • request
    • response
    • routing
    • shipping
    • sms
    • storage
    • user
    • util
    • validator
    • view
    • webasyst
      • api
      • backend
      • cli
      • config
      • layout
      • login
      • model
      • password
      • payment
      • profile
      • settings
      • shipment
    • widget
    • workflow
  • waPlugins
    • Payment
  • webasyst
    • wa-system
      • helper

Classes

  • waAnnouncementModel
  • waApiAuthCodesModel
  • waApiTokensModel
  • waAppSettingsModel
  • waContactCategoriesModel
  • waContactCategoryModel
  • waContactDataModel
  • waContactDataTextModel
  • waContactEmailsModel
  • waContactFieldValuesModel
  • waContactModel
  • waContactRightsModel
  • waContactSettingsModel
  • waCountryModel
  • waGroupModel
  • waLoginLogModel
  • waLogModel
  • waRegionModel
  • waTransactionDataModel
  • waTransactionModel
  • waUserGroupsModel
  • waUserModel
  • waWidgetModel
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class waContactRightsModel

Class to work with user and group access rights.

Each application may store its access rights in a centralized storage kept by this model. It keeps (int) access values associated with (string) app_id, (int) contact_id, (string) name.

To get values for groups, pass a negative group_id instead of contact_id.

waModel
Extended by waContactRightsModel
Package: wa-system\webasyst\model
Located at wa-system/webasyst/lib/models/waContactRights.model.php
Methods summary
public array|integer
# check( string $name )

Check key for current auth user and application

Check key for current auth user and application

Parameters

$name
string
$name

Returns

array|integer
public integer|array
# get( integer|array $id = null, string $app_id = null, string|null $name = null, boolean $check_groups = TRUE )

Get access value for user or group. Value for a group is determined from group acces preferences. Eventual value for a user is MAX(preference for this user, preferences for groups user is member of).

Get access value for user or group. Value for a group is determined from group acces preferences. Eventual value for a user is MAX(preference for this user, preferences for groups user is member of).

Parameters

$id
integer|array
$id (defaults to current auth user) user id if positive; group id if negative (0 is group id for guests); can be a list of such integers.
$app_id
string
$app_id application id; defaults to current application.
$name
string|null
$name key to fetch value for; if not specified, then an array name => value is returned.
$check_groups
boolean
$check_groups (default is true) if set to false then only own access rights are considered, as if contact has no groups assigned

Returns

integer|array
depends on $name
public array
# getAccessStatus( array $ids )

Parameters

$ids
array
$ids list of contact (if positive) or group (if negative) ids.

Returns

array
id => admin|custom; for users with no access at all there's no key=>value pair.
public boolean
# save( integer $id, string $app_id, string $name, integer $value )

Save access preference for user or group.

Save access preference for user or group.

Parameters

$id
integer
$id treated as user id if positive; group id otherwise; 0 is group id for guests.
$app_id
string
$app_id application id
$name
string
$name key to save value for
$value
integer
$value int value to save; negative saved as 0.

Returns

boolean
public array
# getAllowedUsers( mixed $app_id, mixed $name )

Parameters

$app_id
mixed
$app_id
$name
mixed
$name

Returns

array
(contact_id => value) of users allowed for given app and access key
public array
# getAllowedGroups( mixed $app_id, mixed $name )

Parameters

$app_id
mixed
$app_id
$name
mixed
$name

Returns

array
(group_id => value) of groups allowed for given app and access key
public array(group_id
# countApps( )

Returns

array(group_id
=> total number of applications that storage keeps values for, not counting webasyst itself)
public array
# getUsers( string $app_id, string $name = 'backend', integer $value = 1 )

Return array ids of users who have access right to given application

Return array ids of users who have access right to given application

Parameters

$app_id
string
$app_id
$name
string
$name
$value
integer
$value minimal user rights

Returns

array
public array
# getApps( integer|array $id, string $name = 'backend', boolean $check_groups = true, boolean $noWA = true )

Get access rights by group and key

Get access rights by group and key

Parameters

$id
integer|array
$id group ids (if positive) or contact ids (negative)
$name
string
$name key to check value for; default is 'backend'
$check_groups
boolean
$check_groups (default is true) if set to false then only own access rights are considered, as if contact has no groups assigned
$noWA
boolean
$noWA

Returns

array
(app_id => value)
public array
# getByIds( array $ids, null|string $app_id = null, string $name = 'backend', boolean $check_groups = true )

Get rights for all contacts/groups from $ids.

Get rights for all contacts/groups from $ids.

Parameters

$ids
array
$ids
$app_id
null|string
$app_id
$name
string
$name
$check_groups
boolean
$check_groups

Returns

array
Methods inherited from waModel
__construct(), addCacheCleaner(), autocommit(), castValue(), commit(), countAll(), countByField(), createSchema(), database(), deleteByField(), deleteById(), describe(), escape(), escapeField(), exec(), fieldExists(), getAll(), getByField(), getById(), getEmptyRow(), getFieldValue(), getMetadata(), getQueryConstructor(), getTableId(), getTableName(), getWhereByField(), insert(), isAutoIncrement(), multiInsert(), multipleInsert(), order(), ping(), prepare(), query(), replace(), rollback(), select(), setCache(), updateByField(), updateById(), where()
Properties summary
protected static waiCache $cache array()
#

Cache

Cache

protected string $table "wa_contact_rights"
#

Name of the table

Name of the table

Properties inherited from waModel
$adapter, $fields, $id, $type, $writable
My fork of Webasyst Framework API documentation generated by ApiGen 2.8.0