ca.shiftfocus.krispii.core.services

AuthService

Related Doc: package services

trait AuthService extends Service[Fail]

Linear Supertypes
Service[Fail], Lifting[Fail], Serialized, FutureMonad, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. AuthService
  2. Service
  3. Lifting
  4. Serialized
  5. FutureMonad
  6. AnyRef
  7. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def addRole(userId: UUID, roleName: String): Future[\/[Fail, User]]

    Add a role to a user.

    Add a role to a user.

    userId

    the unique id of the user

    roleName

    the name of the role

    returns

    a boolean indicator if the role was added

  2. abstract def addRoles(userId: UUID, roleNames: IndexedSeq[String]): Future[\/[Fail, User]]

    Add several roles to a user.

    Add several roles to a user.

    userId
    roleNames
    returns

  3. abstract def addUsers(roleId: UUID, userIds: IndexedSeq[UUID]): Future[\/[Fail, Unit]]

    Add a role to a given list of users.

    Add a role to a given list of users.

    roleId

    the UUID of the Role to be added

    userIds

    an IndexedSeq of UUID listing the users to gain the role

    returns

    a boolean indicator if the role was added

  4. abstract def authenticate(identifier: String, password: String): Future[\/[Fail, User]]

    Authenticates a given identifier/password combination.

    Authenticates a given identifier/password combination.

    identifier

    a String representing the user's e-mail or username

    password

    a the user's password

    returns

    the optionally authenticated user info

  5. abstract def create(username: String, email: String, password: String, givenname: String, surname: String, id: UUID = UUID.random): Future[\/[Fail, User]]

    Create a new user.

    Create a new user.

    username

    A unique identifier for this user.

    email

    The user's unique e-mail address.

    password

    The user's password.

    givenname

    The user's first name.

    surname

    The user's family name.

    returns

    a future disjunction containing the created user, or a failure

  6. abstract def createRole(name: String, id: UUID = UUID.random): Future[\/[Fail, Role]]

    Create a new role.

    Create a new role.

    name

    the name of the Role to create

    returns

    the newly created Role

  7. abstract def createSession(userId: UUID, ipAddress: String, userAgent: String): Future[\/[Fail, Session]]

  8. abstract val db: DB

    Database connection (pool).

    Database connection (pool). Services will take connections from this pool when making repository calls.

    Definition Classes
    Service
  9. abstract def delete(id: UUID, version: Long): Future[\/[Fail, User]]

    Deletes a user.

    Deletes a user.

    TODO: delete the user's work

    id

    the unique id of the user to be updated

    version

    the latest version of the user for O.O.L.

    returns

    a future disjunction containing the deleted user, or a failure

  10. abstract def deleteRole(id: UUID, version: Long): Future[\/[Fail, Role]]

    Delete a role.

    Delete a role.

    id

    the unique id of the role

    version

    the version of the role for optimistic offline lock

    returns

    the deleted role

  11. abstract def deleteSession(sessionId: UUID): Future[\/[Fail, Session]]

  12. abstract def find(identifier: String): Future[\/[Fail, User]]

    Find a user by their unique identifier.

    Find a user by their unique identifier.

    identifier

    The unique e-mail or username identifying this user.

    returns

    the optionally authenticated user info

  13. abstract def find(id: UUID): Future[\/[Fail, User]]

    Find a user by their UUID.

    Find a user by their UUID.

    id

    the unique id of the user

  14. abstract def findRole(name: String): Future[\/[Fail, Role]]

    Find a specific role by name

    Find a specific role by name

    returns

    an optional Role

  15. abstract def findRole(id: UUID): Future[\/[Fail, Role]]

    Find a specific role by its unique id.

    Find a specific role by its unique id.

    id

    the UUID of the Role to find

    returns

    an optional Role

  16. abstract def findSession(sessionId: UUID): Future[\/[Fail, Session]]

  17. abstract def list(rolesFilter: IndexedSeq[String]): Future[\/[Fail, IndexedSeq[User]]]

    List users with filter for roles and courses.

    List users with filter for roles and courses.

    rolesFilter

    an optional list of roles to filter by

    returns

    a list of users with their roles and courses

  18. abstract def list: Future[\/[Fail, IndexedSeq[User]]]

    List all users.

    List all users.

    returns

    a list of users with their roles and courses

  19. abstract def listRoles(userId: UUID): Future[\/[Fail, IndexedSeq[Role]]]

    List all roles for one user.

    List all roles for one user.

    returns

    an array of this user's Roles

  20. abstract def listRoles: Future[\/[Fail, IndexedSeq[Role]]]

    List all roles.

    List all roles.

    returns

    an array of Roles

  21. abstract def listSessions(userId: UUID): Future[\/[Fail, IndexedSeq[Session]]]

  22. abstract def removeRole(userId: UUID, roleName: String): Future[\/[Fail, User]]

    Remove a role from a user.

    Remove a role from a user.

    userId

    the unique id of the user

    roleName

    the name of the role

    returns

    a boolean indicator if the role was removed

  23. abstract def removeUsers(roleId: UUID, userIds: IndexedSeq[UUID]): Future[\/[Fail, Unit]]

    Remove a role from a given list of users.

    Remove a role from a given list of users.

    roleId

    the UUID of the Role to be removed

    userIds

    an IndexedSeq of UUID listing the users to lose the role

    returns

    a boolean indicator if the role was removed

  24. abstract val roleRepository: RoleRepository

  25. abstract val scalaCache: ScalaCache

  26. abstract val sessionRepository: SessionRepository

  27. abstract def update(id: UUID, version: Long, email: Option[String], username: Option[String], givenname: Option[String], surname: Option[String]): Future[\/[Fail, User]]

    Update a user

    Update a user

    id

    the unique id of the user

    version

    the latest version of the user for O.O.L.

    email

    optionally update the e-mail

    username

    optionally update the username

    givenname

    the user's updated given name

    surname

    the user's updated family name

    returns

    a future disjunction containing the updated user, or a failure

  28. abstract def updateIdentifier(id: UUID, version: Long, email: Option[String], username: Option[String]): Future[\/[Fail, User]]

    Update a user's identifiers.

    Update a user's identifiers.

    id

    the unique id of the user

    version

    the latest version of the user for O.O.L.

    email

    optionally update the e-mail

    username

    optionally update the username

    returns

    a future disjunction containing the updated user, or a failure

  29. abstract def updateInfo(id: UUID, version: Long, givenname: Option[String], surname: Option[String]): Future[\/[Fail, User]]

    Update a user's "non-identifying" information.

    Update a user's "non-identifying" information.

    id

    the unique id of the user to be updated

    version

    the latest version of the user for O.O.L.

    givenname

    the user's updated given name

    surname

    the user's updated family name

    returns

    a future disjunction containing the updated user, or a failure

  30. abstract def updatePassword(id: UUID, version: Long, password: String): Future[\/[Fail, User]]

    Update the user's password.

    Update the user's password.

    id

    the unique id of the user to be updated

    version

    the latest version of the user for O.O.L.

    password

    the new password

    returns

    a future disjunction containing the updated user, or a failure

  31. abstract def updateRole(id: UUID, version: Long, name: String): Future[\/[Fail, Role]]

    Update a Role

    Update a Role

    id

    the unique id of the Role

    version

    the version of the Role for optimistic offline lock

    name

    the new name to assign this Role

    returns

    the newly updated Role

  32. abstract def updateSession(sessionId: UUID, ipAddress: String, userAgent: String): Future[\/[Fail, Session]]

  33. abstract val userRepository: UserRepository

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  5. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. implicit def eitherRunner[B](eithert: EitherT[Future, Fail, B]): Future[\/[Fail, B]]

    Definition Classes
    Lifting
  7. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. implicit val futureMonad: Monad[Future]

    Definition Classes
    FutureMonad
  11. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  12. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  13. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  14. def lift[B]: (Future[\/[Fail, B]]) ⇒ EitherT[Future, Fail, B]

    Definition Classes
    Lifting
  15. def liftSeq[B](fIntermediate: Future[IndexedSeq[\/[Fail, B]]])(implicit ec: ExecutionContext): EitherT[Future, Fail, IndexedSeq[B]]

    Definition Classes
    Lifting
  16. def liftSeq[B](interList: IndexedSeq[Future[\/[Fail, B]]])(implicit ec: ExecutionContext): EitherT[Future, Fail, IndexedSeq[B]]

    Definition Classes
    Lifting
  17. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  18. final def notify(): Unit

    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  20. def predicate(fCondition: Future[Boolean])(fail: Fail)(implicit ec: ExecutionContext): EitherT[Future, Fail, Unit]

    Definition Classes
    Lifting
  21. def predicate(condition: Boolean)(fail: Fail): EitherT[Future, Fail, Unit]

    Definition Classes
    Lifting
  22. def serialized[E, R, L[E] <: IndexedSeq[E]](collection: L[E])(fn: (E) ⇒ Future[R])(implicit ec: ExecutionContext): Future[IndexedSeq[R]]

    Definition Classes
    Serialized
  23. def serializedT[E, R, L[E] <: IndexedSeq[E]](collection: L[E])(fn: (E) ⇒ Future[\/[Fail, R]])(implicit ec: ExecutionContext): Future[\/[Fail, IndexedSeq[R]]]

    Definition Classes
    Lifting
  24. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  25. def toString(): String

    Definition Classes
    AnyRef → Any
  26. def transactional[A](f: (Connection) ⇒ Future[A]): Future[A]

    Takes a function that returns a future, and runs it inside a database transaction.

    Takes a function that returns a future, and runs it inside a database transaction.

    Definition Classes
    Service
  27. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Service[Fail]

Inherited from Lifting[Fail]

Inherited from Serialized

Inherited from FutureMonad

Inherited from AnyRef

Inherited from Any

Ungrouped