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 authorID


    • access = public
    • fieldtype = id
    • returntype = any
    • column = authorID
    • ormtype = string
    • update = false
    • generator = uuid
    • length = 36
    true false
    any authorService


    • access = public
    • returntype = any
    • inject = provider:authorService@contentbox
    • persistent = false
    true false
    any avatar


    • access = public
    • returntype = any
    • inject = provider:Avatar@contentbox
    • persistent = false
    true false
    any biography


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


    • access = public
    • returntype = any
    • column = createdDate
    • notnull = true
    • ormtype = timestamp
    • update = false
    • persistent = true
    true false
    any email


    • access = public
    • returntype = any
    • column = email
    • 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 = true
    true false
    any firstName


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


    • access = public
    • returntype = any
    • column = is2FactorAuth
    • notnull = true
    • ormtype = boolean
    • index = idx_2factorauth
    false true false
    any isActive


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


    • access = public
    • returntype = any
    • column = isDeleted
    • notnull = true
    • ormtype = boolean
    • persistent = true
    false true false
    any isPasswordReset


    • access = public
    • returntype = any
    • column = isPasswordReset
    • notnull = true
    • ormtype = boolean
    • index = idx_passwordReset
    false true false
    any lastLogin


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


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


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


    • access = public
    • returntype = any
    • column = modifiedDate
    • notnull = true
    • ormtype = timestamp
    • persistent = true
    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 = true
    true false
    any password


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


    • linktable = cb_authorPermissionGroups
    • access = public
    • inverse = true
    • fieldtype = many-to-many
    • returntype = any
    • cascade = all
    • orderby = name
    • singularname = permissionGroup
    • fkcolumn = FK_authorID
    • inversejoincolumn = FK_permissionGroupID
    • cfc = contentbox.models.security.PermissionGroup
    • lazy = true
    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
    • fkcolumn = FK_authorID
    • inversejoincolumn = FK_permissionID
    • cfc = contentbox.models.security.Permission
    • lazy = true
    true false
    any preferences


    • access = public
    • returntype = any
    • column = preferences
    • 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
    • column = username
    • notnull = true
    • index = idx_login
    • length = 100
    true false
    Constructor Summary
    init()
          Constructor.
    Method Summary
    any addEntry(any entry)
    any addPage(any page)
    Author addPermissionGroup(any group)
         Add both sides of this relationship: PermissionGroup <-> Author.
    any addPermissions(any permissions)
    boolean checkGroupPermissions(any slug)
         This utility function checks if a slug is in any permission group this user belongs to.
    Author clearPermissionGroups()
         Remove all permission groups.
    Author clearPermissions()
         Remove all permissions.
    struct getAllPreferences()
         Get all user preferences in inflated format.
    string getAuthorID()
    string getAuthorService()
    string getAvatar()
    string getAvatarLink([numeric size='40'])
         Get the avatar link for this user.
    string getBiography()
    string getDisplayLastLogin([any dateFormat='[runtime expression]'], [any timeFormat='[runtime expression]'])
         Get formatted lastLogin.
    string getEmail()
    string getEntries()
    string getFirstName()
    string getFullName()
         Retrieve full name.
    struct getInfoSnapshot()
         Utility method to get a snapshot of the user information.
    string getIs2FactorAuth()
    string getIsActive()
    string getIsPasswordReset()
    struct getJwtCustomClaims()
         A struct of custom claims to add to the JWT token.
    array getJwtScopes()
         This function returns an array of all the scopes that should be attached to the JWT token that will be used for authorization.
    string getLastLogin()
    string getLastName()
    string getLoggedIn()
    numeric getNumberOfContent()
         Get the total number of content items this author has created.
    numeric getNumberOfContentStore()
         Get the total number of content store items this author has created.
    numeric getNumberOfEntries()
         Get the total number of entries this author has created.
    numeric getNumberOfPages()
         Get the total number of pages this author has created.
    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 getRoleName()
         Get the user's role name.
    string getUsername()
    boolean hasEntry([any entry])
    boolean hasPage([any page])
    boolean hasPermission(any permission)
         Verify if the author has one or more of the passed in permissions.
    boolean hasPermissionGroup([any permissionGroup])
    boolean hasPermissions([any permissions])
    boolean hasRole([any role])
    any inPermissionList(any permission)
         Verify the incoming permission is assigned in this user.
    any isLoggedIn()
         Utility method to verify if an author has been logged in to the system or not.
    boolean removeEntry(any entry)
    boolean removePage(any page)
    Author removePermissionGroup(any group)
         Remove both sides of this relationship: PermissionGroup <-> Author.
    boolean removePermissions(any permissions)
    any setAuthorID(any authorID)
    any setAuthorService(any authorService)
    any setAvatar(any avatar)
    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 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
    appendToMemento, appendToMementoProfile, arrayWrap, getDisplayCreatedDate, getDisplayModifiedDate, getEntityName, getId, includeMixin, isLoaded, preInsert, preUpdate
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init()

    Constructor


    Property Detail

    authorID

    property any authorID

    Attributes:
    access - public
    required - false
    fieldtype - id
    returntype - any
    column - authorID
    ormtype - string
    update - false
    generator - uuid
    length - 36
    serializable - true

    authorService

    property any authorService

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

    avatar

    property any avatar

    Attributes:
    access - public
    required - false
    returntype - any
    inject - provider:Avatar@contentbox
    persistent - false
    serializable - true

    biography

    property any biography

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

    createdDate

    property date createdDate

    Attributes:
    access - public
    required - false
    returntype - any
    column - createdDate
    notnull - true
    ormtype - timestamp
    update - false
    persistent - true
    serializable - true

    email

    property any email

    Attributes:
    access - public
    required - false
    returntype - any
    column - email
    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 - true

    firstName

    property any firstName

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

    is2FactorAuth

    property any is2FactorAuth = [false]

    Attributes:
    access - public
    required - false
    returntype - any
    column - is2FactorAuth
    notnull - true
    ormtype - boolean
    index - idx_2factorauth
    serializable - true

    isActive

    property any isActive = [false]

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

    isDeleted

    property any isDeleted = [false]

    Attributes:
    access - public
    required - false
    returntype - any
    column - isDeleted
    notnull - true
    ormtype - boolean
    persistent - true
    serializable - true

    isPasswordReset

    property any isPasswordReset = [false]

    Attributes:
    access - public
    required - false
    returntype - any
    column - isPasswordReset
    notnull - true
    ormtype - boolean
    index - idx_passwordReset
    serializable - true

    lastLogin

    property any lastLogin

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

    lastName

    property any lastName

    Attributes:
    access - public
    required - false
    returntype - any
    column - lastName
    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
    column - modifiedDate
    notnull - true
    ormtype - timestamp
    persistent - true
    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 - true

    password

    property any password

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

    permissionGroups

    property array permissionGroups

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

    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
    fkcolumn - FK_authorID
    serializable - true
    inversejoincolumn - FK_permissionID
    cfc - contentbox.models.security.Permission
    lazy - true

    preferences

    property any preferences

    Attributes:
    access - public
    required - false
    returntype - any
    column - preferences
    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
    column - username
    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

    addPermissionGroup

    public Author addPermissionGroup(any group)

    Add both sides of this relationship: PermissionGroup <-> Author

    Parameters:
    group - The permission group to add

    addPermissions

    public any addPermissions(any permissions)

    Parameters:
    permissions

    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

    clearPermissionGroups

    public Author clearPermissionGroups()

    Remove all permission groups


    clearPermissions

    public Author clearPermissions()

    Remove all permissions


    getAllPreferences

    public struct getAllPreferences()

    Get all user preferences in inflated format


    getAuthorID

    public string getAuthorID()


    getAuthorService

    public string getAuthorService()


    getAvatar

    public string getAvatar()


    getAvatarLink

    public string getAvatarLink([numeric size='40'])

    Get the avatar link for this user.

    Parameters:
    size - The size of the avatar, defaults to 40

    getBiography

    public string getBiography()


    getDisplayLastLogin

    public string getDisplayLastLogin([any dateFormat='[runtime expression]'], [any timeFormat='[runtime expression]'])

    Get formatted lastLogin

    Parameters:
    dateFormat
    timeFormat

    getEmail

    public string getEmail()


    getEntries

    public string getEntries()


    getFirstName

    public string getFirstName()


    getFullName

    public string getFullName()

    Retrieve full name


    getInfoSnapshot

    public struct getInfoSnapshot()

    Utility method to get a snapshot of the user information


    getIs2FactorAuth

    public string getIs2FactorAuth()


    getIsActive

    public string getIsActive()


    getIsPasswordReset

    public string getIsPasswordReset()


    getJwtCustomClaims

    public struct getJwtCustomClaims()

    A struct of custom claims to add to the JWT token


    getJwtScopes

    public array getJwtScopes()

    This function returns an array of all the scopes that should be attached to the JWT token that will be used for authorization.


    getLastLogin

    public string getLastLogin()


    getLastName

    public string getLastName()


    getLoggedIn

    public string getLoggedIn()


    getNumberOfContent

    public numeric getNumberOfContent()

    Get the total number of content items this author has created


    getNumberOfContentStore

    public numeric getNumberOfContentStore()

    Get the total number of content store items this author has created


    getNumberOfEntries

    public numeric getNumberOfEntries()

    Get the total number of entries this author has created


    getNumberOfPages

    public numeric getNumberOfPages()

    Get the total number of pages this author has created


    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()


    getRoleName

    public string getRoleName()

    Get the user's role name


    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)

    Verify if the author has one or more of the passed in permissions

    Parameters:
    permission - One or a list of permissions to check for access

    hasPermissionGroup

    public boolean hasPermissionGroup([any permissionGroup])

    Parameters:
    permissionGroup

    hasPermissions

    public boolean hasPermissions([any permissions])

    Parameters:
    permissions

    hasRole

    public boolean hasRole([any role])

    Parameters:
    role

    inPermissionList

    public any inPermissionList(any permission)

    Verify the incoming permission is assigned in this user

    Parameters:
    permission - A list or array of permission to check

    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.


    removeEntry

    public boolean removeEntry(any entry)

    Parameters:
    entry

    removePage

    public boolean removePage(any page)

    Parameters:
    page

    removePermissionGroup

    public Author removePermissionGroup(any group)

    Remove both sides of this relationship: PermissionGroup <-> Author

    Parameters:
    group - The permission group to add

    removePermissions

    public boolean removePermissions(any permissions)

    Parameters:
    permissions

    setAuthorID

    public any setAuthorID(any authorID)

    Parameters:
    authorID

    setAuthorService

    public any setAuthorService(any authorService)

    Parameters:
    authorService

    setAvatar

    public any setAvatar(any avatar)

    Parameters:
    avatar

    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

    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