contentbox.models.security

Interface ISecurityService

contentbox.models.security.ISecurityService
All Known Implementing Classes:
SecurityService

ContentBox - A Modular Content Platform Copyright since 2012 by Ortus Solutions, Corp www.ortussolutions.com/products/contentbox --- This is the ContentBox Security Service needed for security to be implemented in ContentBox

Class Attributes:
None
Method Summary
struct authenticate(any username, any password)
     Authenticate an author via ContentBox credentials.
boolean authorizeContent(any content, any password)
     Check to authorize a user to view a content entry or page.
Author getAuthorSession()
     Get an author from session, or returns a new empty author entity.
boolean isContentViewable(any content)
     Checks Whether a content entry or page is protected and user has credentials for it.
ISecurityService logout()
     Delete author session.
struct resetUserPassword(any token, Author author, any password)
     Resets a user's password.
struct sendPasswordReminder(Author author, [boolean adminIssued], [Author issuer])
     Send password reminder for an author.
ISecurityService setAuthorSession(Author author)
     Set a new author in session.
boolean userValidator(struct rule, [any controller])
     User validator via security interceptor.

Method Detail

authenticate

public struct authenticate(any username, any password)

Authenticate an author via ContentBox credentials. This method returns a structure containing an indicator if the authentication was valid (`isAuthenticated` and The `author` object which it represents.

Parameters:
username - The username to validate
password - The password to validate
Returns:
struct:{ isAuthenticated:boolean, author:Author }

authorizeContent

public boolean authorizeContent(any content, any password)

Check to authorize a user to view a content entry or page

Parameters:
content
password

getAuthorSession

public Author getAuthorSession()

Get an author from session, or returns a new empty author entity


isContentViewable

public boolean isContentViewable(any content)

Checks Whether a content entry or page is protected and user has credentials for it

Parameters:
content

logout

public ISecurityService logout()

Delete author session


resetUserPassword

public struct resetUserPassword(any token, Author author, any password)

Resets a user's password.

Parameters:
token
author
password

sendPasswordReminder

public struct sendPasswordReminder(Author author, [boolean adminIssued], [Author issuer])

Send password reminder for an author

Parameters:
author
adminIssued
issuer

setAuthorSession

public ISecurityService setAuthorSession(Author author)

Set a new author in session

Parameters:
author

userValidator

public boolean userValidator(struct rule, [any controller])

User validator via security interceptor

Parameters:
rule
controller