contentbox.models.security

Class Author

lucee.Component
    extended by contentbox.models.BaseEntityMethods
      extended by contentbox.models.BaseEntity
        extended by contentbox.models.security.Author

ContentBox - A Modular Content Platform Copyright since 2012 by Ortus Solutions, Corp www.ortussolutions.com/products/contentbox --- I am a ContentBox User/Author entity

Class Attributes:
  • entityname : cbAuthor
  •  
  • cacheuse : read-write
  •  
  • table : cb_author
  •  
  • synchronized : false
  •  
  • cachename : cbAuthor
  •  
  • batchsize : 25
  •  
  • accessors : false
  •  
  • persistent : true
  •  
    Property Summary
    type property default serializable required
    any APIToken


    • access = public
    • unique = true
    • returntype = any
    • notnull = false
    • index = idx_apitoken
    • length = 255
    true false
    any authorID


    • access = public
    • fieldtype = id
    • returntype = any
    • params = { allocationSize = 1, sequence = 'authorID_seq' }
    • generator = native
    • setter = no
    true false
    any authorService


    • access = public
    • returntype = any
    • inject = authorService@cb
    • persistent = false
    true false
    any biography


    • access = public
    • returntype = any
    • notnull = false
    • ormtype = text
    • length = 8000
    true false
    date createdDate


    • access = public
    • returntype = any
    • notnull = true
    • ormtype = timestamp
    • update = false
    • index = idx_createDate
    true false
    any email


    • access = public
    • returntype = any
    • notnull = true
    • index = idx_email
    • length = 255
    true false
    array entries


    • access = public
    • inverse = true
    • fieldtype = one-to-many
    • returntype = any
    • cascade = save-update
    • orderby = publishedDate DESC
    • batchsize = 10
    • singularname = entry
    • fkcolumn = FK_authorID
    • cfc = contentbox.models.content.Entry
    • lazy = extra
    true false
    any firstName


    • access = public
    • returntype = any
    • notnull = true
    • length = 100
    true false
    any is2FactorAuth


    • access = public
    • dbdefault = 0
    • returntype = any
    • notnull = true
    • ormtype = boolean
    • index = idx_2factorauth
    • sqltype = bit
    false true false
    any isActive


    • access = public
    • returntype = any
    • notnull = true
    • ormtype = boolean
    • index = idx_login,idx_activeAuthor
    false true false
    any isDeleted


    • access = public
    • dbdefault = 0
    • returntype = any
    • notnull = true
    • ormtype = boolean
    • index = idx_deleted
    • sqltype = bit
    false true false
    any isPasswordReset


    • access = public
    • dbdefault = 0
    • returntype = any
    • notnull = true
    • ormtype = boolean
    • index = idx_passwordReset
    • sqltype = bit
    false true false
    any lastLogin


    • access = public
    • returntype = any
    • notnull = false
    • ormtype = timestamp
    true false
    any lastName


    • access = public
    • returntype = any
    • notnull = true
    • length = 100
    true false
    boolean loggedIn


    • access = public
    • returntype = any
    • persistent = false
    false true false
    date modifiedDate


    • access = public
    • returntype = any
    • notnull = true
    • ormtype = timestamp
    • index = idx_modifiedDate
    true false
    any numberOfContentStore


    • access = public
    • returntype = any
    • formula = select count(*) from cb_content as content where content.FK_authorID=authorID and content.contentType = 'ContentStore'
    true false
    any numberOfEntries


    • access = public
    • returntype = any
    • formula = select count(*) from cb_content as content where content.FK_authorID=authorID and content.contentType = 'Entry'
    true false
    any numberOfPages


    • access = public
    • returntype = any
    • formula = select count(*) from cb_content as content where content.FK_authorID=authorID and content.contentType = 'Page'
    true false
    array pages


    • access = public
    • inverse = true
    • fieldtype = one-to-many
    • returntype = any
    • cascade = save-update
    • orderby = publishedDate DESC
    • batchsize = 10
    • singularname = page
    • fkcolumn = FK_authorID
    • cfc = contentbox.models.content.Page
    • lazy = extra
    true false
    any password


    • access = public
    • returntype = any
    • notnull = true
    • index = idx_login
    • length = 100
    true false
    array permissionGroups


    • linktable = cb_authorPermissionGroups
    • access = public
    • fieldtype = many-to-many
    • returntype = any
    • cascade = save-update
    • orderby = name
    • singularname = permissionGroup
    • fkcolumn = FK_authorID
    • inversejoincolumn = FK_permissionGroupID
    • cfc = contentbox.models.security.PermissionGroup
    • lazy = extra
    true false
    any permissionList


    • access = public
    • returntype = any
    • persistent = false
    true false
    array permissions


    • linktable = cb_authorPermissions
    • access = public
    • fieldtype = many-to-many
    • returntype = any
    • cascade = save-update
    • orderby = permission
    • singularname = permission
    • fkcolumn = FK_authorID
    • inversejoincolumn = FK_permissionID
    • cfc = contentbox.models.security.Permission
    • lazy = extra
    true false
    any preferences


    • access = public
    • returntype = any
    • notnull = false
    • ormtype = text
    • length = 8000
    true false
    any role


    • access = public
    • fieldtype = many-to-one
    • returntype = any
    • notnull = true
    • fkcolumn = FK_roleID
    • cfc = contentbox.models.security.Role
    • lazy = true
    true false
    any username


    • access = public
    • unique = true
    • returntype = any
    • notnull = true
    • index = idx_login
    • length = 100
    true false
    Constructor Summary
    init()
          Constructor.
    Method Summary
    any addEntry(any entry)
    any addPage(any page)
    any addPermission(any permission)
    any addPermissionGroup(any permissionGroup)
    boolean checkGroupPermissions(any slug)
         This utility function checks if a slug is in any permission group this user belongs to.
    boolean checkPermission(any slug)
         Check for permission.
    Author clearPermissions()
         Clear all permissions.
    Author generateAPIToken()
         Generate new API Token, stores it locally but does not persist it.
    struct getAllPreferences()
         Get all user preferences in inflated format.
    string getAPIToken()
    string getAuthorID()
    string getAuthorService()
    string getBiography()
    string getDisplayLastLogin()
         Get formatted lastLogin.
    string getEmail()
    string getEntries()
    string getFirstName()
    string getIs2FactorAuth()
    string getIsActive()
    string getIsPasswordReset()
    string getLastLogin()
    string getLastName()
    string getLoggedIn()
    any getMemento([any excludes='pages,entries'], [boolean showRole='true'], [boolean showPermissions='true'], [boolean showPermissionGroups='true'])
         Get a flat representation of this entry.
    string getName()
         Retrieve full name.
    string getNumberOfContentStore()
    string getNumberOfEntries()
    string getNumberOfPages()
    string getPages()
    string getPassword()
    string getPermissionGroups()
    string getPermissionGroupsList([any delimiter=','])
         Shortcut Utlity function to get a list of all the permission groups this user belongs to.
    string getPermissionList()
    string getPermissions()
    any getPreference(any name, [any defaultValue])
         Get a preference, you can pass a default value if preference does not exist.
    string getPreferences()
    string getRole()
    string getUsername()
    boolean hasEntry([any entry])
    boolean hasPage([any page])
    boolean hasPermission([any permission])
    boolean hasPermissionGroup([any permissionGroup])
    boolean hasRole([any role])
    any inPermissionList(any list)
         Verify that a passed in list of perms the user can use.
    any isLoggedIn()
         Utility method to verify if an author has been logged in to the system or not.
    any postLoad()
         Listen to postLoad's from the ORM.
    boolean removeEntry(any entry)
    boolean removePage(any page)
    boolean removePermission(any permission)
    boolean removePermissionGroup(any permissionGroup)
    any setAPIToken(any APIToken)
    any setAuthorService(any authorService)
    any setBiography(any biography)
    any setEmail(any email)
    any setEntries(array entries)
    any setFirstName(any firstName)
    any setIs2FactorAuth(any is2FactorAuth)
    any setIsActive(any isActive)
    any setIsPasswordReset(any isPasswordReset)
    any setLastLogin(any lastLogin)
    any setLastName(any lastName)
    any setLoggedIn(boolean loggedIn)
    any setNumberOfContentStore(any numberOfContentStore)
    any setNumberOfEntries(any numberOfEntries)
    any setNumberOfPages(any numberOfPages)
    any setPages(array pages)
    any setPassword(any password)
    any setPermissionGroups(array permissionGroups)
    any setPermissionList(any permissionList)
    Author setPermissions(array permissions)
         Override the setPermissions.
    Author setPreference(any name, any value)
         Set a preference in the user preferences.
    Author setPreferences(any preferences)
         Store a preferences structure or JSON data in the user prefernces.
    any setRole(any role)
    any setUsername(any username)
     
    Methods inherited from class contentbox.models.BaseEntity
    getCreatedDate, getIsDeleted, getModifiedDate, setCreatedDate, setIsDeleted, setModifiedDate
     
    Methods inherited from class contentbox.models.BaseEntityMethods
    getBaseMemento, getDisplayCreatedDate, getDisplayModifiedDate, isLoaded, preInsert, preUpdate
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init()

    Constructor


    Property Detail

    APIToken

    property any APIToken

    Attributes:
    access - public
    unique - true
    required - false
    returntype - any
    notnull - false
    index - idx_apitoken
    length - 255
    serializable - true

    authorID

    property any authorID

    Attributes:
    access - public
    required - false
    fieldtype - id
    returntype - any
    params - { allocationSize = 1, sequence = 'authorID_seq' }
    generator - native
    serializable - true
    setter - no

    authorService

    property any authorService

    Attributes:
    access - public
    required - false
    returntype - any
    inject - authorService@cb
    persistent - false
    serializable - true

    biography

    property any biography

    Attributes:
    access - public
    required - false
    returntype - any
    notnull - false
    ormtype - text
    length - 8000
    serializable - true

    createdDate

    property date createdDate

    Attributes:
    access - public
    required - false
    returntype - any
    notnull - true
    ormtype - timestamp
    update - false
    index - idx_createDate
    serializable - true

    email

    property any email

    Attributes:
    access - public
    required - false
    returntype - any
    notnull - true
    index - idx_email
    length - 255
    serializable - true

    entries

    property array entries

    Attributes:
    access - public
    required - false
    inverse - true
    fieldtype - one-to-many
    returntype - any
    cascade - save-update
    orderby - publishedDate DESC
    batchsize - 10
    singularname - entry
    fkcolumn - FK_authorID
    serializable - true
    cfc - contentbox.models.content.Entry
    lazy - extra

    firstName

    property any firstName

    Attributes:
    access - public
    required - false
    returntype - any
    notnull - true
    length - 100
    serializable - true

    is2FactorAuth

    property any is2FactorAuth = [false]

    Attributes:
    access - public
    required - false
    dbdefault - 0
    returntype - any
    notnull - true
    ormtype - boolean
    index - idx_2factorauth
    serializable - true
    sqltype - bit

    isActive

    property any isActive = [false]

    Attributes:
    access - public
    required - false
    returntype - any
    notnull - true
    ormtype - boolean
    index - idx_login,idx_activeAuthor
    serializable - true

    isDeleted

    property any isDeleted = [false]

    Attributes:
    access - public
    required - false
    dbdefault - 0
    returntype - any
    notnull - true
    ormtype - boolean
    index - idx_deleted
    serializable - true
    sqltype - bit

    isPasswordReset

    property any isPasswordReset = [false]

    Attributes:
    access - public
    required - false
    dbdefault - 0
    returntype - any
    notnull - true
    ormtype - boolean
    index - idx_passwordReset
    serializable - true
    sqltype - bit

    lastLogin

    property any lastLogin

    Attributes:
    access - public
    required - false
    returntype - any
    notnull - false
    ormtype - timestamp
    serializable - true

    lastName

    property any lastName

    Attributes:
    access - public
    required - false
    returntype - any
    notnull - true
    length - 100
    serializable - true

    loggedIn

    property boolean loggedIn = [false]

    Attributes:
    access - public
    required - false
    returntype - any
    persistent - false
    serializable - true

    modifiedDate

    property date modifiedDate

    Attributes:
    access - public
    required - false
    returntype - any
    notnull - true
    ormtype - timestamp
    index - idx_modifiedDate
    serializable - true

    numberOfContentStore

    property any numberOfContentStore

    Attributes:
    access - public
    required - false
    returntype - any
    formula - select count(*) from cb_content as content where content.FK_authorID=authorID and content.contentType = 'ContentStore'
    serializable - true

    numberOfEntries

    property any numberOfEntries

    Attributes:
    access - public
    required - false
    returntype - any
    formula - select count(*) from cb_content as content where content.FK_authorID=authorID and content.contentType = 'Entry'
    serializable - true

    numberOfPages

    property any numberOfPages

    Attributes:
    access - public
    required - false
    returntype - any
    formula - select count(*) from cb_content as content where content.FK_authorID=authorID and content.contentType = 'Page'
    serializable - true

    pages

    property array pages

    Attributes:
    access - public
    required - false
    inverse - true
    fieldtype - one-to-many
    returntype - any
    cascade - save-update
    orderby - publishedDate DESC
    batchsize - 10
    singularname - page
    fkcolumn - FK_authorID
    serializable - true
    cfc - contentbox.models.content.Page
    lazy - extra

    password

    property any password

    Attributes:
    access - public
    required - false
    returntype - any
    notnull - true
    index - idx_login
    length - 100
    serializable - true

    permissionGroups

    property array permissionGroups

    Attributes:
    linktable - cb_authorPermissionGroups
    access - public
    required - false
    fieldtype - many-to-many
    returntype - any
    cascade - save-update
    orderby - name
    singularname - permissionGroup
    fkcolumn - FK_authorID
    serializable - true
    inversejoincolumn - FK_permissionGroupID
    cfc - contentbox.models.security.PermissionGroup
    lazy - extra

    permissionList

    property any permissionList

    Attributes:
    access - public
    required - false
    returntype - any
    persistent - false
    serializable - true

    permissions

    property array permissions

    Attributes:
    linktable - cb_authorPermissions
    access - public
    required - false
    fieldtype - many-to-many
    returntype - any
    cascade - save-update
    orderby - permission
    singularname - permission
    fkcolumn - FK_authorID
    serializable - true
    inversejoincolumn - FK_permissionID
    cfc - contentbox.models.security.Permission
    lazy - extra

    preferences

    property any preferences

    Attributes:
    access - public
    required - false
    returntype - any
    notnull - false
    ormtype - text
    length - 8000
    serializable - true

    role

    property any role

    Attributes:
    access - public
    required - false
    fieldtype - many-to-one
    returntype - any
    notnull - true
    fkcolumn - FK_roleID
    serializable - true
    cfc - contentbox.models.security.Role
    lazy - true

    username

    property any username

    Attributes:
    access - public
    unique - true
    required - false
    returntype - any
    notnull - true
    index - idx_login
    length - 100
    serializable - true

    Method Detail

    addEntry

    public any addEntry(any entry)

    Parameters:
    entry

    addPage

    public any addPage(any page)

    Parameters:
    page

    addPermission

    public any addPermission(any permission)

    Parameters:
    permission

    addPermissionGroup

    public any addPermissionGroup(any permissionGroup)

    Parameters:
    permissionGroup

    checkGroupPermissions

    public boolean checkGroupPermissions(any slug)

    This utility function checks if a slug is in any permission group this user belongs to.

    Parameters:
    slug - The slug to check

    checkPermission

    public boolean checkPermission(any slug)

    Check for permission

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

    clearPermissions

    public Author clearPermissions()

    Clear all permissions


    generateAPIToken

    public Author generateAPIToken()

    Generate new API Token, stores it locally but does not persist it.


    getAllPreferences

    public struct getAllPreferences()

    Get all user preferences in inflated format


    getAPIToken

    public string getAPIToken()


    getAuthorID

    public string getAuthorID()


    getAuthorService

    public string getAuthorService()


    getBiography

    public string getBiography()


    getDisplayLastLogin

    public string getDisplayLastLogin()

    Get formatted lastLogin


    getEmail

    public string getEmail()


    getEntries

    public string getEntries()


    getFirstName

    public string getFirstName()


    getIs2FactorAuth

    public string getIs2FactorAuth()


    getIsActive

    public string getIsActive()


    getIsPasswordReset

    public string getIsPasswordReset()


    getLastLogin

    public string getLastLogin()


    getLastName

    public string getLastName()


    getLoggedIn

    public string getLoggedIn()


    getMemento

    public any getMemento([any excludes='pages,entries'], [boolean showRole='true'], [boolean showPermissions='true'], [boolean showPermissionGroups='true'])

    Get a flat representation of this entry

    Parameters:
    excludes - Exclude properties, by default it does pages and entries
    showRole - Show Roles
    showPermissions - Show permissions
    showPermissionGroups - Show permission groups

    getName

    public string getName()

    Retrieve full name


    getNumberOfContentStore

    public string getNumberOfContentStore()


    getNumberOfEntries

    public string getNumberOfEntries()


    getNumberOfPages

    public string getNumberOfPages()


    getPages

    public string getPages()


    getPassword

    public string getPassword()


    getPermissionGroups

    public string getPermissionGroups()


    getPermissionGroupsList

    public string getPermissionGroupsList([any delimiter=','])

    Shortcut Utlity function to get a list of all the permission groups this user belongs to.

    Parameters:
    delimiter

    getPermissionList

    public string getPermissionList()


    getPermissions

    public string getPermissions()


    getPreference

    public any getPreference(any name, [any defaultValue])

    Get a preference, you can pass a default value if preference does not exist

    Parameters:
    name
    defaultValue

    getPreferences

    public string getPreferences()


    getRole

    public string getRole()


    getUsername

    public string getUsername()


    hasEntry

    public boolean hasEntry([any entry])

    Parameters:
    entry

    hasPage

    public boolean hasPage([any page])

    Parameters:
    page

    hasPermission

    public boolean hasPermission([any permission])

    Parameters:
    permission

    hasPermissionGroup

    public boolean hasPermissionGroup([any permissionGroup])

    Parameters:
    permissionGroup

    hasRole

    public boolean hasRole([any role])

    Parameters:
    role

    inPermissionList

    public any inPermissionList(any list)

    Verify that a passed in list of perms the user can use

    Parameters:
    list

    isLoggedIn

    public any isLoggedIn()

    Utility method to verify if an author has been logged in to the system or not. This method does not account for permissions. Only for logged in status.


    postLoad

    public any postLoad()

    Listen to postLoad's from the ORM


    removeEntry

    public boolean removeEntry(any entry)

    Parameters:
    entry

    removePage

    public boolean removePage(any page)

    Parameters:
    page

    removePermission

    public boolean removePermission(any permission)

    Parameters:
    permission

    removePermissionGroup

    public boolean removePermissionGroup(any permissionGroup)

    Parameters:
    permissionGroup

    setAPIToken

    public any setAPIToken(any APIToken)

    Parameters:
    APIToken

    setAuthorService

    public any setAuthorService(any authorService)

    Parameters:
    authorService

    setBiography

    public any setBiography(any biography)

    Parameters:
    biography

    setEmail

    public any setEmail(any email)

    Parameters:
    email

    setEntries

    public any setEntries(array entries)

    Parameters:
    entries

    setFirstName

    public any setFirstName(any firstName)

    Parameters:
    firstName

    setIs2FactorAuth

    public any setIs2FactorAuth(any is2FactorAuth)

    Parameters:
    is2FactorAuth

    setIsActive

    public any setIsActive(any isActive)

    Parameters:
    isActive

    setIsPasswordReset

    public any setIsPasswordReset(any isPasswordReset)

    Parameters:
    isPasswordReset

    setLastLogin

    public any setLastLogin(any lastLogin)

    Parameters:
    lastLogin

    setLastName

    public any setLastName(any lastName)

    Parameters:
    lastName

    setLoggedIn

    public any setLoggedIn(boolean loggedIn)

    Parameters:
    loggedIn

    setNumberOfContentStore

    public any setNumberOfContentStore(any numberOfContentStore)

    Parameters:
    numberOfContentStore

    setNumberOfEntries

    public any setNumberOfEntries(any numberOfEntries)

    Parameters:
    numberOfEntries

    setNumberOfPages

    public any setNumberOfPages(any numberOfPages)

    Parameters:
    numberOfPages

    setPages

    public any setPages(array pages)

    Parameters:
    pages

    setPassword

    public any setPassword(any password)

    Parameters:
    password

    setPermissionGroups

    public any setPermissionGroups(array permissionGroups)

    Parameters:
    permissionGroups

    setPermissionList

    public any setPermissionList(any permissionList)

    Parameters:
    permissionList

    setPermissions

    public Author setPermissions(array permissions)

    Override the setPermissions

    Parameters:
    permissions - The permissions array to override

    setPreference

    public Author setPreference(any name, any value)

    Set a preference in the user preferences

    Parameters:
    name
    value

    setPreferences

    public Author setPreferences(any preferences)

    Store a preferences structure or JSON data in the user prefernces

    Parameters:
    preferences - A struct of data or a JSON packet to store

    setRole

    public any setRole(any role)

    Parameters:
    role

    setUsername

    public any setUsername(any username)

    Parameters:
    username