org.drools.repository.security
Class PermissionManager

java.lang.Object
  extended by org.drools.repository.security.PermissionManager

public class PermissionManager
extends Object

Deals with storing permissions for data and so on.


Constructor Summary
PermissionManager(RulesRepository repo)
           
 
Method Summary
 void createUser(String userName)
           
static javax.jcr.Node getNode(javax.jcr.Node node, String name, String nodeType)
          Gets or creates a node.
static javax.jcr.Node getRootNode(RulesRepository repo)
          The root node of the repository
static javax.jcr.Node getUserInfoNode(String userName, RulesRepository repo)
          get the specified user info node (it is an nt:folder type)
static javax.jcr.Node getUsersRootNode(javax.jcr.Node root)
          Get the top node for "user_info"
 Map<String,List<String>> listUsers()
          Returns a list of users and their permissions types for display.
 void removeUserPermissions(String userName)
           
 Map<String,List<String>> retrieveUserPermissions(String userName)
          obtain a mapping of permissions for a given user.
 void updateUserPermissions(String userName, Map<String,List<String>> perms)
          Save the users permissions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PermissionManager

public PermissionManager(RulesRepository repo)
Method Detail

updateUserPermissions

public void updateUserPermissions(String userName,
                                  Map<String,List<String>> perms)
Save the users permissions.

Parameters:
userName - = obviously, the user name.
perms - - a map of the role type to the targets that it applies to. eg: package.admin => PACKAGE UUID analyst => category path ADMIN => empty (no list needed for admin)
Throws:
javax.jcr.RepositoryException

createUser

public void createUser(String userName)

getUserInfoNode

public static javax.jcr.Node getUserInfoNode(String userName,
                                             RulesRepository repo)
                                      throws javax.jcr.RepositoryException
get the specified user info node (it is an nt:folder type)

Throws:
javax.jcr.RepositoryException

getRootNode

public static javax.jcr.Node getRootNode(RulesRepository repo)
                                  throws javax.jcr.RepositoryException
The root node of the repository

Throws:
javax.jcr.RepositoryException

getUsersRootNode

public static javax.jcr.Node getUsersRootNode(javax.jcr.Node root)
                                       throws javax.jcr.RepositoryException
Get the top node for "user_info"

Throws:
javax.jcr.RepositoryException

retrieveUserPermissions

public Map<String,List<String>> retrieveUserPermissions(String userName)
obtain a mapping of permissions for a given user.

Throws:
javax.jcr.RepositoryException

getNode

public static javax.jcr.Node getNode(javax.jcr.Node node,
                                     String name,
                                     String nodeType)
                              throws javax.jcr.RepositoryException
Gets or creates a node.

Throws:
javax.jcr.RepositoryException

listUsers

public Map<String,List<String>> listUsers()
Returns a list of users and their permissions types for display. The Map maps: userName => [list of permission types, eg admin, package.admin etc... no IDs] For display purposes only.

Throws:
javax.jcr.RepositoryException

removeUserPermissions

public void removeUserPermissions(String userName)


Copyright © 2001-2013 JBoss by Red Hat. All Rights Reserved.