Interface PermissionRepository

    • Method Detail

      • isAllowed

        boolean isAllowed​(String action,
                          Set<String> profileRoles,
                          String context)
                   throws org.craftercms.commons.mongo.MongoDataException
        Checks if the Actions is allow for a given set of Roles for the context.
        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

        Iterable<SocialSecurityAction> findActions​(String context)
                                            throws org.craftercms.commons.mongo.MongoDataException
        Returns all the actions for the context.
        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

        SocialSecurityAction updateSecurityAction​(String context,
                                                  String actionName,
                                                  List<String> roles)
                                           throws org.craftercms.commons.mongo.MongoDataException
        Updates the SecurityAction based
        Parameters:
        context -
        actionName -
        roles -
        Returns:
        The updated SecurityAction, null if context/action does not exist.
        Throws:
        org.craftercms.commons.mongo.MongoDataException
      • save

        void save​(SocialSecurityAction action)
           throws org.craftercms.commons.mongo.MongoDataException
        Saves a new Action.
        Parameters:
        action - New Action to save.
        Throws:
        org.craftercms.commons.mongo.MongoDataException - If unable to save.