ContentBox Core API 1.6.0

contentbox.model.security
Class Role

WEB-INF.cftags.component
        extended by contentbox.model.security.Role

public class Role
extends WEB-INF.cftags.component

******************************************************************************* ContentBox - A Modular Content Platform Copyright 2012 by Luis Majano and Ortus Solutions, Corp www.gocontentbox.org | www.luismajano.com | 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 & Description Default Serializable Required
 any description


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


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


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


Attributes:
  • persistent = false
true false
 any permissionService


Attributes:
  • inject = permissionService@cb
  • persistent = false
true false
 array permissions


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


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


Attributes:
  • generator = native
  • fieldtype = id
  • setter = false
true false
 
Constructor Summary
init()
 
Method Summary
 void ADDPERMISSION(Permission permission)
 any GETDESCRIPTION()
          get:
 any GETNUMBEROFAUTHORS()
          get:
 any GETNUMBEROFPERMISSIONS()
          get:
 any GETPERMISSIONLIST()
          get:
 array GETPERMISSIONS()
          get:
 any GETPERMISSIONSERVICE()
          get:
 any GETROLE()
          get:
 any GETROLEID()
          get:
 boolean HASPERMISSION([Permission permissions])
 boolean REMOVEPERMISSION(Permission permission)
 Role SETDESCRIPTION(any description)
          set:
 Role SETNUMBEROFAUTHORS(any numberOfAuthors)
          set:
 Role SETNUMBEROFPERMISSIONS(any numberOfPermissions)
          set:
 Role SETPERMISSIONLIST(any permissionList)
          set:
 Role SETPERMISSIONSERVICE(any permissionService)
          set:
 Role SETROLE(any role)
          set:
 boolean checkPermission(any slug)
          Check for permission
 Role clearPermissions()
          Clear all permissions
 any getMemento()
          Get memento representation
 boolean isLoaded()
          is loaded?
 Role setPermissions(array permissions)
          Override the setPermissions
 
Methods inherited from class WEB-INF.cftags.component
None
 

Constructor Detail

init

public init()

Property Detail

description

any description

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

numberOfAuthors

any numberOfAuthors

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

numberOfPermissions

any numberOfPermissions

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

permissionList

any permissionList

Attributes:
required - false
serializable - true
persistent - false
default -

permissionService

any permissionService

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

permissions

array permissions

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

role

any role

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

roleID

any roleID

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

Method Detail

ADDPERMISSION

public void ADDPERMISSION(Permission permission)

Parameters:
permission

GETDESCRIPTION

public any GETDESCRIPTION()
get:


GETNUMBEROFAUTHORS

public any GETNUMBEROFAUTHORS()
get:


GETNUMBEROFPERMISSIONS

public any GETNUMBEROFPERMISSIONS()
get:


GETPERMISSIONLIST

public any GETPERMISSIONLIST()
get:


GETPERMISSIONS

public array GETPERMISSIONS()
get:


GETPERMISSIONSERVICE

public any GETPERMISSIONSERVICE()
get:


GETROLE

public any GETROLE()
get:


GETROLEID

public any GETROLEID()
get:


HASPERMISSION

public boolean HASPERMISSION([Permission permissions])

Parameters:
permissions

REMOVEPERMISSION

public boolean REMOVEPERMISSION(Permission permission)

Parameters:
permission

SETDESCRIPTION

public Role SETDESCRIPTION(any description)
set:

Parameters:
description

SETNUMBEROFAUTHORS

public Role SETNUMBEROFAUTHORS(any numberOfAuthors)
set:

Parameters:
numberOfAuthors

SETNUMBEROFPERMISSIONS

public Role SETNUMBEROFPERMISSIONS(any numberOfPermissions)
set:

Parameters:
numberOfPermissions

SETPERMISSIONLIST

public Role SETPERMISSIONLIST(any permissionList)
set:

Parameters:
permissionList

SETPERMISSIONSERVICE

public Role SETPERMISSIONSERVICE(any permissionService)
set:

Parameters:
permissionService

SETROLE

public Role SETROLE(any role)
set:

Parameters:
role

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


getMemento

public any getMemento()
Get memento representation


isLoaded

public boolean isLoaded()
is loaded?


setPermissions

public Role setPermissions(array permissions)
Override the setPermissions

Parameters:
permissions

ContentBox Core API 1.6.0