Hawk - PHP documentation
  • Namespace
  • Class
  • Tree

Namespaces

  • Hawk
    • View
      • Plugins

Classes

  • App
  • ButtonInput
  • Cache
  • CheckboxInput
  • ColorInput
  • Conf
  • Controller
  • Crypto
  • DatabaseSessionHandler
  • DatetimeInput
  • DB
  • DBExample
  • DeleteInput
  • Dialogbox
  • EmailInput
  • ErrorHandler
  • Event
  • FileInput
  • FileSystem
  • FloatInput
  • Form
  • FormFieldset
  • FormInput
  • GenericModel
  • GifImage
  • HawkApi
  • HawkUpdater
  • HiddenInput
  • HtmlInput
  • HTTPRequest
  • Icon
  • Image
  • IntegerInput
  • ItemList
  • ItemListField
  • JpegImage
  • Lang
  • Language
  • LeftSidebarTab
  • Less
  • Logger
  • Mail
  • MenuItem
  • Model
  • NoSidebarTab
  • NumberInput
  • ObjectInput
  • Option
  • Panel
  • PasswordInput
  • Permission
  • Plugin
  • PluginInstaller
  • PngImage
  • ProfileQuestion
  • ProfileQuestionValue
  • RadioInput
  • Request
  • Response
  • RightSidebarTab
  • Role
  • RolePermission
  • Route
  • Router
  • SelectInput
  • Session
  • Singleton
  • SubmitInput
  • Tabs
  • TextareaInput
  • TextInput
  • Theme
  • TimeInput
  • Upload
  • User
  • View
  • ViewPlugin
  • Widget
  • WysiwygInput

Traits

  • Utils

Exceptions

  • AppStopException
  • DBExampleException
  • DBException
  • FileSystemException
  • HawkApiException
  • ImageException
  • MailException
  • UploadException
  • ViewException

Class Permission

This class describes the permission model

Hawk\Model uses Hawk\Utils
Extended by Hawk\Permission
Namespace: Hawk
Package: BaseModels
Located at models/Permission.php

Methods summary

public static array
# getAllGroupByPlugin( )

Get all permissions, grouped by plugin name

Get all permissions, grouped by plugin name

Returns

array
The list of permissions, indexed by the plugins names, where each element is an array contaning the plugin permissions
public static array
# getPluginPermissions( string $plugin )

Get all the permissions for a given plugin

Get all the permissions for a given plugin

Parameters

$plugin
The plugin name

Returns

array
The list of found permissions
public static Hawk\Permission
# getByName( string $name )

Get a permission by it name, formatted as .

Get a permission by it name, formatted as .

Parameters

$name
The permission name

Returns

Hawk\Permission
The found permission
public static Hawk\Permission
# add( string $name, integer $default = 1, integer $availableForGuest = 0 )

Add a new permission in the database

Add a new permission in the database

Parameters

$name
The permission name, formatted as "."
$default
The default value for this permission
$availableForGuest
Defines if the permission can be set to true for guest users

Returns

Hawk\Permission
The created permission

Overrides

Hawk\Model::add

Methods inherited from Hawk\Model

__construct(), addIfNotExists(), countElementsByExample(), countElementsBySQL(), delete(), deleteByExample(), deleteBySQL(), getAll(), getByExample(), getById(), getBySQL(), getData(), getDbInstance(), getDbName(), getListByExample(), getListBySQL(), getPrimaryColumn(), getTable(), save(), set(), setDbName(), setPrimaryColumn(), setTable(), update()

Methods used from Hawk\Utils

debug(), getSerializedVersion(), map()

Constants summary

integer ALL_PRIVILEGES_ID

The id of the permission giving rights on all permissions

The id of the permission giving rights on all permissions

# 1
string ALL_PRIVILEGES_NAME

The name of the permission giving rights on all permissions

The name of the permission giving rights on all permissions

# 'admin.all'

Properties summary

protected static string $tablename

The associated table

The associated table

# "Permission"

Properties inherited from Hawk\Model

$dbname, $primaryColumn

Hawk - PHP documentation API documentation generated by ApiGen