Class WikiItemAttributePermissionHome
java.lang.Object
fr.paris.lutece.plugins.wiki.business.permission.WikiItemAttributePermissionHome
Home for permissions granted on a directory attribute value.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcreate(int nIdItem, String strAttributeName, String strAttributeValue, String strAttributeLabel, String strPermissionType) Grants a permission to everyone carrying an attribute value.static List<WikiItemAttributePermission>findByAttributeValues(Map<String, String> mapUserAttributes) Returns every rule matching one of the attribute values a user carries.static List<WikiItemAttributePermission>findByItemAndType(int nIdItem, String strPermissionType) Returns the rules of an item for a permission type.static voidRevokes a rule of an item.
-
Method Details
-
create
public static void create(int nIdItem, String strAttributeName, String strAttributeValue, String strAttributeLabel, String strPermissionType) Grants a permission to everyone carrying an attribute value. Does nothing when already granted.- Parameters:
nIdItem- the item identifierstrAttributeName- the attribute namestrAttributeValue- the attribute valuestrAttributeLabel- the attribute label, as shown to whoever granted the rulestrPermissionType- the permission type
-
remove
public static void remove(int nIdItem, String strAttributeName, String strAttributeValue, String strPermissionType) Revokes a rule of an item.- Parameters:
nIdItem- the item identifierstrAttributeName- the attribute namestrAttributeValue- the attribute valuestrPermissionType- the permission type
-
findByItemAndType
public static List<WikiItemAttributePermission> findByItemAndType(int nIdItem, String strPermissionType) Returns the rules of an item for a permission type.- Parameters:
nIdItem- the item identifierstrPermissionType- the permission type- Returns:
- the rules, ordered by label
-
findByAttributeValues
public static List<WikiItemAttributePermission> findByAttributeValues(Map<String, String> mapUserAttributes) Returns every rule matching one of the attribute values a user carries.- Parameters:
mapUserAttributes- the attribute values the user carries, keyed by attribute name- Returns:
- the matching rules
-