contentbox.model.security

Class Role

railo-context.Component
        extended by contentbox.model.security.Role
Class Attributes:
  • entityname : cbRole
  •  
  • cacheuse : read-write
  •  
  • table : cb_role
  •  
  • synchronized : false
  •  
  • cachename : cbRole
  •  
  • accessors : false
  •  
  • persistent : true
  •  

    ContentBox - A Modular Content Platform Copyright 2012 by Luis Majano and Ortus Solutions, Corp www.ortussolutions.com Apache License, Version 2.0 Copyright Since [2012] [Luis Majano and Ortus Solutions,Corp] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. A cool Role entity

    Property Summary
    type property default serializable required
    any description


    • notnull = false
    • ormtype = string
    • length = 500
    true false
    any numberOfAuthors


    • formula = select count(*) from cb_author as author where author.FK_roleID=roleID
    true false
    any numberOfPermissions


    • formula = select count(*) from cb_rolePermissions as rolePermissions where rolePermissions.FK_roleID=roleID
    true false
    any permissionList


    • persistent = false
    true false
    array permissions


    • linktable = cb_rolePermissions
    • fieldtype = many-to-many
    • cascade = all
    • cacheuse = read-write
    • orderby = permission
    • singularname = permission
    • fkcolumn = FK_roleID
    • inversejoincolumn = FK_permissionID
    • cfc = contentbox.model.security.Permission
    • lazy = extra
    true false
    any permissionService


    • inject = permissionService@cb
    • persistent = false
    true false
    any role


    • unique = true
    • notnull = true
    • ormtype = string
    • length = 255
    true false
    any roleID


    • fieldtype = id
    • generator = native
    • setter = no
    true false
    Constructor Summary
    init()
    Method Summary
    any addPermission(any permission)
    boolean checkPermission(any slug)
         Check for permission.
    Role clearPermissions()
         Clear all permissions.
    string getDescription()
    any getMemento()
         Get memento representation.
    string getName()
         Get the role name, same as getRole().
    string getNumberOfAuthors()
    string getNumberOfPermissions()
    string getPermissionList()
    string getPermissions()
    string getPermissionService()
    string getRole()
    string getRoleID()
    boolean hasPermission([any permission])
    boolean isLoaded()
         is loaded?.
    boolean removePermission(any permission)
    any setDescription(any description)
    any setNumberOfAuthors(any numberOfAuthors)
    any setNumberOfPermissions(any numberOfPermissions)
    any setPermissionList(any permissionList)
    Role setPermissions(array permissions)
         Override the setPermissions.
    any setPermissionService(any permissionService)
    any setRole(any role)
     
    Methods inherited from class railo-context.Component
    None

    Constructor Detail

    init

    public init()


    Property Detail

    description

    property any description

    Attributes:
    required - false
    notnull - false
    ormtype - string
    length - 500
    serializable - true

    numberOfAuthors

    property any numberOfAuthors

    Attributes:
    required - false
    formula - select count(*) from cb_author as author where author.FK_roleID=roleID
    serializable - true

    numberOfPermissions

    property any numberOfPermissions

    Attributes:
    required - false
    formula - select count(*) from cb_rolePermissions as rolePermissions where rolePermissions.FK_roleID=roleID
    serializable - true

    permissionList

    property any permissionList

    Attributes:
    required - false
    persistent - false
    serializable - true

    permissions

    property array permissions

    Attributes:
    linktable - cb_rolePermissions
    required - false
    fieldtype - many-to-many
    cascade - all
    cacheuse - read-write
    orderby - permission
    singularname - permission
    fkcolumn - FK_roleID
    serializable - true
    inversejoincolumn - FK_permissionID
    cfc - contentbox.model.security.Permission
    lazy - extra

    permissionService

    property any permissionService

    Attributes:
    required - false
    inject - permissionService@cb
    persistent - false
    serializable - true

    role

    property any role

    Attributes:
    unique - true
    required - false
    notnull - true
    ormtype - string
    length - 255
    serializable - true

    roleID

    property any roleID

    Attributes:
    required - false
    fieldtype - id
    generator - native
    serializable - true
    setter - no

    Method Detail

    addPermission

    public any addPermission(any permission)

    Parameters:
    permission

    checkPermission

    public boolean checkPermission(any slug)

    Check for permission

    Parameters:
    slug - The permission slug or list of slugs to validate the role has. If it's a list then they are ORed together

    clearPermissions

    public Role clearPermissions()

    Clear all permissions


    getDescription

    public string getDescription()


    getMemento

    public any getMemento()

    Get memento representation


    getName

    public string getName()

    Get the role name, same as getRole()


    getNumberOfAuthors

    public string getNumberOfAuthors()


    getNumberOfPermissions

    public string getNumberOfPermissions()


    getPermissionList

    public string getPermissionList()


    getPermissions

    public string getPermissions()


    getPermissionService

    public string getPermissionService()


    getRole

    public string getRole()


    getRoleID

    public string getRoleID()


    hasPermission

    public boolean hasPermission([any permission])

    Parameters:
    permission

    isLoaded

    public boolean isLoaded()

    is loaded?


    removePermission

    public boolean removePermission(any permission)

    Parameters:
    permission

    setDescription

    public any setDescription(any description)

    Parameters:
    description

    setNumberOfAuthors

    public any setNumberOfAuthors(any numberOfAuthors)

    Parameters:
    numberOfAuthors

    setNumberOfPermissions

    public any setNumberOfPermissions(any numberOfPermissions)

    Parameters:
    numberOfPermissions

    setPermissionList

    public any setPermissionList(any permissionList)

    Parameters:
    permissionList

    setPermissions

    public Role setPermissions(array permissions)

    Override the setPermissions

    Parameters:
    permissions

    setPermissionService

    public any setPermissionService(any permissionService)

    Parameters:
    permissionService

    setRole

    public any setRole(any role)

    Parameters:
    role