Class PermissionRepositoryImpl

    • Field Summary

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

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

      • PermissionRepositoryImpl

        public PermissionRepositoryImpl()
    • Method Detail

      • 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