contentbox.models.security

Class AuthorService

lucee.Component
    extended by cborm.models.BaseORMService
      extended by cborm.models.VirtualEntityService
        extended by contentbox.models.security.AuthorService

ContentBox - A Modular Content Platform Copyright since 2012 by Ortus Solutions, Corp www.ortussolutions.com/products/contentbox --- Service to handle user operations.

Class Attributes:
  • singleton
  •  
  • synchronized : false
  •  
  • accessors : true
  •  
  • persistent : false
  •  
    Property Summary
    type property default serializable required
    any CBHelper


    • access = public
    • returntype = any
    • inject = CBHelper@contentbox
    true false
    any bCrypt


    • access = public
    • returntype = any
    • inject = BCrypt@BCrypt
    true false
    any dateUtil


    • access = public
    • returntype = any
    • inject = DateUtil@contentbox
    true false
    any mailService


    • access = public
    • returntype = any
    • inject = mailService@cbmailservices
    true false
    any permissionGroupService


    • access = public
    • returntype = any
    • inject = permissionGroupService@contentbox
    true false
    any permissionService


    • access = public
    • returntype = any
    • inject = permissionService@contentbox
    true false
    any renderer


    • access = public
    • returntype = any
    • inject = coldbox:renderer
    true false
    any requestService


    • access = public
    • returntype = any
    • inject = coldbox:requestService
    true false
    any roleService


    • access = public
    • returntype = any
    • inject = roleService@contentbox
    true false
    any securityService


    • access = public
    • returntype = any
    • inject = provider:securityService@contentbox
    true false
    any settingService


    • access = public
    • returntype = any
    • inject = provider:settingService@contentbox
    true false
    any siteService


    • access = public
    • returntype = any
    • inject = provider:siteService@contentbox
    true false
    Constructor Summary
    init()
          Constructor.
    Method Summary
    Author createNewAuthor(any author)
         Create a new author in ContentBox and sends them their email confirmations.
    AuthorService delete(any author)
         Delete an author from the system.
    boolean emailFound(any email)
         Email checks for authors.
    array getAllForExport()
         Get all data prepared for export.
    string getBCrypt()
    string getCBHelper()
    string getDateUtil()
    string getMailService()
    string getPermissionGroupService()
    string getPermissionService()
    string getRenderer()
    string getRequestService()
    string getRoleService()
    string getSecurityService()
    string getSettingService()
    string getSiteService()
    any getStatusReport()
         Get a status report of authors in the system.
    numeric getTotalContent(any authorId)
         Get the total number of content items an author has created.
    numeric getTotalContentStoreItems(any authorId)
         Get the total number of content store items an author has created.
    numeric getTotalEntries(any authorId)
         Get the total number of entries an author has created.
    numeric getTotalPages(any authorId)
         Get the total number of pages an author has created.
    string importFromData(any importData, [boolean override='false'], [any importLog])
         Import data from an array of structures or a single structure of data.
    string importFromFile(any importFile, [boolean override='false'])
         Import data from a ContentBox JSON file.
    boolean isSameHash(any incoming, any target)
         This function will encrypt an incoming target string using bcrypt and compare it with another bcrypt string.
    Author retrieveUserById(any id)
         Get an author by id which is active and not deleted.
    Author retrieveUserByUsername(any username)
         Get an author by username which is active and not deleted.
    Author save(any author, [boolean passwordChange='false'])
         Save an author with extra pizazz!.
    any search([string searchTerm=''], [string isActive], [string role], [numeric max='0'], [numeric offset='0'], [boolean asQuery='false'], [string sortOrder='lastName'], [string permissionGroups], [string twoFactorAuth])
         Author search by many criteria.
    struct sendNewUserEmail(Author author)
         Sends a new author their reminder to reset their password and log in to their account.
    any setBCrypt(any bCrypt)
    any setCBHelper(any CBHelper)
    any setDateUtil(any dateUtil)
    any setMailService(any mailService)
    any setPermissionGroupService(any permissionGroupService)
    any setPermissionService(any permissionService)
    any setRenderer(any renderer)
    any setRequestService(any requestService)
    any setRoleService(any roleService)
    any setSecurityService(any securityService)
    any setSettingService(any settingService)
    any setSiteService(any siteService)
    boolean usernameFound(any username)
         Username checks for authors.
     
    Methods inherited from class cborm.models.VirtualEntityService
    autoCast, convertIdValueToJavaType, convertValueToJavaType, count, countWhere, deleteAll, deleteByID, deleteByQuery, deleteWhere, evictCollection, executeQuery, exists, findAllWhere, findWhere, get, getAll, getEntityName, getKey, getOrFail, getPropertyNames, getTableName, idCast, list, new, newCriteria, onMissingMethod, setEntityName
     
    Methods inherited from class cborm.models.BaseORMService
    $transactioned, buildJavaProxy, clear, createService, evict, evictQueries, findAll, findByExample, findIt, findOrFail, getBeanPopulator, getDatasource, getDefaultAsQuery, getDirtyPropertyNames, getDynamicProcessor, getEntityGivenName, getEntityMetadata, getEventHandling, getKeyValue, getLogger, getORMEventHandler, getObjectPopulator, getOrm, getPropertyValues, getQueryCacheRegion, getRestrictions, getSessionStatistics, getStringBuilder, getUseQueryCaching, getUseTransactions, getWirebox, isDirty, isSessionDirty, merge, nullValue, populate, populateFromJson, populateFromQuery, populateFromXml, populateWithPrefix, refresh, saveAll, sessionContains, setDatasource, setDefaultAsQuery, setEventHandling, setLogger, setORM, setORMEventHandler, setQueryCacheRegion, setUseQueryCaching, setUseTransactions, setWirebox, when
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init()

    Constructor


    Property Detail

    CBHelper

    property any CBHelper

    Attributes:
    access - public
    required - false
    returntype - any
    inject - CBHelper@contentbox
    serializable - true

    bCrypt

    property any bCrypt

    Attributes:
    access - public
    required - false
    returntype - any
    inject - BCrypt@BCrypt
    serializable - true

    dateUtil

    property any dateUtil

    Attributes:
    access - public
    required - false
    returntype - any
    inject - DateUtil@contentbox
    serializable - true

    mailService

    property any mailService

    Attributes:
    access - public
    required - false
    returntype - any
    inject - mailService@cbmailservices
    serializable - true

    permissionGroupService

    property any permissionGroupService

    Attributes:
    access - public
    required - false
    returntype - any
    inject - permissionGroupService@contentbox
    serializable - true

    permissionService

    property any permissionService

    Attributes:
    access - public
    required - false
    returntype - any
    inject - permissionService@contentbox
    serializable - true

    renderer

    property any renderer

    Attributes:
    access - public
    required - false
    returntype - any
    inject - coldbox:renderer
    serializable - true

    requestService

    property any requestService

    Attributes:
    access - public
    required - false
    returntype - any
    inject - coldbox:requestService
    serializable - true

    roleService

    property any roleService

    Attributes:
    access - public
    required - false
    returntype - any
    inject - roleService@contentbox
    serializable - true

    securityService

    property any securityService

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

    settingService

    property any settingService

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

    siteService

    property any siteService

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

    Method Detail

    createNewAuthor

    public Author createNewAuthor(any author)

    Create a new author in ContentBox and sends them their email confirmations.

    Parameters:
    author - The target author object to create
    Returns:
    The created author

    delete

    public AuthorService delete(any author)

    Delete an author from the system

    Overrides:
    delete in class cborm.models.BaseORMService
    Parameters:
    author - The author to delete

    emailFound

    public boolean emailFound(any email)

    Email checks for authors

    Parameters:
    email - The email to check if it exists already

    getAllForExport

    public array getAllForExport()

    Get all data prepared for export


    getBCrypt

    public string getBCrypt()


    getCBHelper

    public string getCBHelper()


    getDateUtil

    public string getDateUtil()


    getMailService

    public string getMailService()


    getPermissionGroupService

    public string getPermissionGroupService()


    getPermissionService

    public string getPermissionService()


    getRenderer

    public string getRenderer()


    getRequestService

    public string getRequestService()


    getRoleService

    public string getRoleService()


    getSecurityService

    public string getSecurityService()


    getSettingService

    public string getSettingService()


    getSiteService

    public string getSiteService()


    getStatusReport

    public any getStatusReport()

    Get a status report of authors in the system.


    getTotalContent

    public numeric getTotalContent(any authorId)

    Get the total number of content items an author has created

    Parameters:
    authorId - The author id to report on

    getTotalContentStoreItems

    public numeric getTotalContentStoreItems(any authorId)

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

    Parameters:
    authorId - The author id to report on

    getTotalEntries

    public numeric getTotalEntries(any authorId)

    Get the total number of entries an author has created

    Parameters:
    authorId - The author id to report on

    getTotalPages

    public numeric getTotalPages(any authorId)

    Get the total number of pages an author has created

    Parameters:
    authorId - The author id to report on

    importFromData

    public string importFromData(any importData, [boolean override='false'], [any importLog])

    Import data from an array of structures or a single structure of data

    Parameters:
    importData - A struct or array of data to import
    override - Override content if found in the database, defaults to false
    importLog - The import log buffer
    Returns:
    The console log of the import
    Throws:
    RoleNotFoundException - Whenever you try to import an author with an invalid role

    importFromFile

    public string importFromFile(any importFile, [boolean override='false'])

    Import data from a ContentBox JSON file. Returns the import log

    Parameters:
    importFile - The json file to import
    override - Override content if found in the database, defaults to false
    Returns:
    The console log of the import
    Throws:
    InvalidImportFormat

    isSameHash

    public boolean isSameHash(any incoming, any target)

    This function will encrypt an incoming target string using bcrypt and compare it with another bcrypt string

    Parameters:
    incoming - Incoming string
    target - Target check
    Returns:
    true if they match

    retrieveUserById

    public Author retrieveUserById(any id)

    Get an author by id which is active and not deleted

    Parameters:
    id - The unique Id
    Throws:
    EntityNotFound

    retrieveUserByUsername

    public Author retrieveUserByUsername(any username)

    Get an author by username which is active and not deleted

    Parameters:
    username - The username to verify the user with
    Throws:
    EntityNotFound

    save

    public Author save(any author, [boolean passwordChange='false'])

    Save an author with extra pizazz!

    Overrides:
    save in class cborm.models.BaseORMService
    Parameters:
    author - The author object
    passwordChange - Are we changing the password
    Returns:
    Author

    search

    public any search([string searchTerm=''], [string isActive], [string role], [numeric max='0'], [numeric offset='0'], [boolean asQuery='false'], [string sortOrder='lastName'], [string permissionGroups], [string twoFactorAuth])

    Author search by many criteria.

    Parameters:
    searchTerm - Search in firstname, lastname and email fields
    isActive - Search with active bit
    role - Apply a role filter
    max - The max returned objects
    offset - The offset for pagination
    asQuery - Query or objects
    sortOrder - The sort order to apply
    permissionGroups - Single or list of permissiong groups to search on
    twoFactorAuth - Two factor auth or any
    Returns:
    {authors:array, count:numeric}

    sendNewUserEmail

    public struct sendNewUserEmail(Author author)

    Sends a new author their reminder to reset their password and log in to their account

    Parameters:
    author - The author to send the reminder to
    Returns:
    struct of { error:boolean, messages:array }

    setBCrypt

    public any setBCrypt(any bCrypt)

    Parameters:
    bCrypt

    setCBHelper

    public any setCBHelper(any CBHelper)

    Parameters:
    CBHelper

    setDateUtil

    public any setDateUtil(any dateUtil)

    Parameters:
    dateUtil

    setMailService

    public any setMailService(any mailService)

    Parameters:
    mailService

    setPermissionGroupService

    public any setPermissionGroupService(any permissionGroupService)

    Parameters:
    permissionGroupService

    setPermissionService

    public any setPermissionService(any permissionService)

    Parameters:
    permissionService

    setRenderer

    public any setRenderer(any renderer)

    Parameters:
    renderer

    setRequestService

    public any setRequestService(any requestService)

    Parameters:
    requestService

    setRoleService

    public any setRoleService(any roleService)

    Parameters:
    roleService

    setSecurityService

    public any setSecurityService(any securityService)

    Parameters:
    securityService

    setSettingService

    public any setSettingService(any settingService)

    Parameters:
    settingService

    setSiteService

    public any setSiteService(any siteService)

    Parameters:
    siteService

    usernameFound

    public boolean usernameFound(any username)

    Username checks for authors

    Parameters:
    username - The username to check if it exists already