org.mentawai.authorization
Class AuthorizationManager

java.lang.Object
  extended by org.mentawai.authorization.AuthorizationManager
All Implemented Interfaces:
Serializable

public class AuthorizationManager
extends Object
implements Serializable

Author:
Sergio Oliveira
See Also:
Serialized Form

Field Summary
protected static Set<Group> groups
           
protected static Map<String,Group> groupsMap
           
protected static Map<Integer,Group> groupsMapId
           
 
Constructor Summary
AuthorizationManager()
           
 
Method Summary
static void addGroup(Group g)
           
static void addListGroup(ListData data)
           
static boolean check(Group group, String permission)
          Check if the permission exists in the group.
static boolean check(String group, String permission)
           
static boolean checkAny(Group group, List<String> permissions)
          check if the any permissions exists in the group
static boolean checkAny(String group, List<String> permissions)
           
static Group getGroup(int id)
           
static Group getGroup(String groupName)
           
static boolean hasGroup(Group g)
           
static boolean hasGroup(int id)
           
static boolean hasGroup(String name)
           
static void setUserGroup(Group g, Context session)
           
static void setUserGroup(int groupId, Context session)
           
static void setUserGroup(String group, Context session)
           
static void setUserGroups(List groups, Context session)
           
static void setUserGroups(String groups, Context session)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

groups

protected static Set<Group> groups

groupsMap

protected static Map<String,Group> groupsMap

groupsMapId

protected static Map<Integer,Group> groupsMapId
Constructor Detail

AuthorizationManager

public AuthorizationManager()
Method Detail

addListGroup

public static void addListGroup(ListData data)

addGroup

public static void addGroup(Group g)

hasGroup

public static boolean hasGroup(Group g)

hasGroup

public static boolean hasGroup(String name)

hasGroup

public static boolean hasGroup(int id)

getGroup

public static Group getGroup(String groupName)

getGroup

public static Group getGroup(int id)

check

public static boolean check(String group,
                            String permission)

checkAny

public static boolean checkAny(String group,
                               List<String> permissions)

check

public static boolean check(Group group,
                            String permission)
Check if the permission exists in the group.

Returns:
true if the permission exists.

checkAny

public static boolean checkAny(Group group,
                               List<String> permissions)
check if the any permissions exists in the group

Returns:
true if any permission exists.

setUserGroup

public static void setUserGroup(String group,
                                Context session)

setUserGroups

public static void setUserGroups(List groups,
                                 Context session)

setUserGroup

public static void setUserGroup(Group g,
                                Context session)

setUserGroup

public static void setUserGroup(int groupId,
                                Context session)

setUserGroups

public static void setUserGroups(String groups,
                                 Context session)
Deprecated. 

User setUserGroups(Context session, String ... groups) instead...

Parameters:
groups -
session -


Copyright © 2013. All Rights Reserved.