Class PermissionRepositoryImpl

java.lang.Object
org.craftercms.commons.mongo.AbstractJongoRepository<SocialSecurityAction>
org.craftercms.social.repositories.security.impl.PermissionRepositoryImpl
All Implemented Interfaces:
org.craftercms.commons.mongo.CrudRepository<SocialSecurityAction>, PermissionRepository

public class PermissionRepositoryImpl extends org.craftercms.commons.mongo.AbstractJongoRepository<SocialSecurityAction> implements PermissionRepository
  • Field Summary

    Fields inherited from class org.craftercms.commons.mongo.AbstractJongoRepository

    clazz, collectionName, gridfs, jongo, queries
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns all the actions for the context.
    boolean
    isAllowed(String action, Set<String> profileRoles, String context)
    Checks if the Actions is allow for a given set of Roles for the context.
    updateSecurityAction(String context, String actionName, List<String> roles)
    Updates the SecurityAction based

    Methods inherited from class org.craftercms.commons.mongo.AbstractJongoRepository

    count, count, count, createSortQuery, deleteFile, deleteFile, find, find, findAll, findById, findByStringId, findOne, findOne, getCollection, getFileInfo, getFileInfo, getQueryFor, init, insert, insert, listFilesByName, readFile, readFile, remove, remove, removeById, removeByStringId, returnList, returnSimple, save, save, saveFile, saveFile, setJongo, setQueries, update, update, update, update, updateFile, updateFile, updateFile, validateObject, validateObject

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.craftercms.social.repositories.security.PermissionRepository

    save
  • Constructor Details

    • PermissionRepositoryImpl

      public PermissionRepositoryImpl()
  • Method Details

    • isAllowed

      public boolean isAllowed(String action, Set<String> profileRoles, String context) throws org.craftercms.commons.mongo.MongoDataException
      Description copied from interface: PermissionRepository
      Checks if the Actions is allow for a given set of Roles for the context.
      Specified by:
      isAllowed in interface PermissionRepository
      Parameters:
      action - Actions to check.
      profileRoles - Roles to check action against.
      context - Context of the action.
      Returns:
      True if any of the given roles can execute the action, false otherwise.
      Throws:
      org.craftercms.commons.mongo.MongoDataException - If unable to check.
    • findActions

      public Iterable<SocialSecurityAction> findActions(String context) throws org.craftercms.commons.mongo.MongoDataException
      Description copied from interface: PermissionRepository
      Returns all the actions for the context.
      Specified by:
      findActions in interface PermissionRepository
      Parameters:
      context - Context of the action.
      Returns:
      A list of all the security Actions. Empty if nothing is found.
      Throws:
      org.craftercms.commons.mongo.MongoDataException
    • updateSecurityAction

      public SocialSecurityAction updateSecurityAction(String context, String actionName, List<String> roles) throws org.craftercms.commons.mongo.MongoDataException
      Description copied from interface: PermissionRepository
      Updates the SecurityAction based
      Specified by:
      updateSecurityAction in interface PermissionRepository
      Parameters:
      context -
      actionName -
      roles -
      Returns:
      The updated SecurityAction, null if context/action does not exist.
      Throws:
      org.craftercms.commons.mongo.MongoDataException