Package org.javlo.user
Class AdminUserSecurity
- java.lang.Object
-
- org.javlo.user.AdminUserSecurity
-
- All Implemented Interfaces:
Serializable
public class AdminUserSecurity extends Object implements Serializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
ADD_ONLY
static String
ADMIN_USER_ROLE
static String
CONTENT_ROLE
static String
CONTRIBUTOR_ROLE
static String
CUSTOMER_ROLE
static String
DESIGN_ROLE
static String
FULL_CONTROL_ROLE
static String
GENERAL_ADMIN
static String
LIGHT_INTERFACE_ROLE
static String
MACRO_ROLE
static String
MAILING_ROLE
static String
MASTER
static String
MODEL_ROLE
static String
NAVIGATION_ROLE
static String
PROVIDER_ROLE
static String
PUBLISHER_ROLE
static String
STATISTICS_ROLE
static String
SYNCHRO_ADMIN
static String
SYNCHRO_CLIENT
static String
SYNCHRO_SERVER
static String
UPLOAD_RESOURCE
static String
USER_ROLE
static String
VALIDATION_ROLE
static String
VIEW_ACCESS
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canModifyConponent(ContentContext ctx, String compId)
static boolean
canModifyPage(ContentContext ctx, MenuElement page, boolean createMessage)
check if the currentPage is editable by current user.boolean
canRole(User user, String inRole)
static AdminUserSecurity
getInstance()
boolean
haveRight(User user, String... inRights)
check right (admin have all right)boolean
haveRight(User user, Collection<String> rights)
return true if user have one of all right.boolean
haveRole(IUserInfo user, String inRole)
boolean
haveRole(User user, String inRole)
boolean
isAdmin(User user)
return true if user have no restrictionstatic boolean
isCurrentUserCanUpload(ContentContext ctx)
boolean
isGod(User user)
return true if user have no restriction on all websiteboolean
isMaster(User user)
boolean
isViewOnly(User user)
-
-
-
Field Detail
-
GENERAL_ADMIN
public static final String GENERAL_ADMIN
- See Also:
- Constant Field Values
-
FULL_CONTROL_ROLE
public static final String FULL_CONTROL_ROLE
- See Also:
- Constant Field Values
-
CONTENT_ROLE
public static final String CONTENT_ROLE
- See Also:
- Constant Field Values
-
MODEL_ROLE
public static final String MODEL_ROLE
- See Also:
- Constant Field Values
-
CONTRIBUTOR_ROLE
public static final String CONTRIBUTOR_ROLE
- See Also:
- Constant Field Values
-
DESIGN_ROLE
public static final String DESIGN_ROLE
- See Also:
- Constant Field Values
-
MACRO_ROLE
public static final String MACRO_ROLE
- See Also:
- Constant Field Values
-
MAILING_ROLE
public static final String MAILING_ROLE
- See Also:
- Constant Field Values
-
LIGHT_INTERFACE_ROLE
public static final String LIGHT_INTERFACE_ROLE
- See Also:
- Constant Field Values
-
VALIDATION_ROLE
public static final String VALIDATION_ROLE
- See Also:
- Constant Field Values
-
NAVIGATION_ROLE
public static final String NAVIGATION_ROLE
- See Also:
- Constant Field Values
-
USER_ROLE
public static final String USER_ROLE
- See Also:
- Constant Field Values
-
CUSTOMER_ROLE
public static final String CUSTOMER_ROLE
- See Also:
- Constant Field Values
-
PROVIDER_ROLE
public static final String PROVIDER_ROLE
- See Also:
- Constant Field Values
-
ADMIN_USER_ROLE
public static final String ADMIN_USER_ROLE
- See Also:
- Constant Field Values
-
STATISTICS_ROLE
public static final String STATISTICS_ROLE
- See Also:
- Constant Field Values
-
PUBLISHER_ROLE
public static final String PUBLISHER_ROLE
- See Also:
- Constant Field Values
-
SYNCHRO_CLIENT
public static final String SYNCHRO_CLIENT
- See Also:
- Constant Field Values
-
SYNCHRO_ADMIN
public static final String SYNCHRO_ADMIN
- See Also:
- Constant Field Values
-
ADD_ONLY
public static final String ADD_ONLY
- See Also:
- Constant Field Values
-
VIEW_ACCESS
public static final String VIEW_ACCESS
- See Also:
- Constant Field Values
-
SYNCHRO_SERVER
public static final String SYNCHRO_SERVER
- See Also:
- Constant Field Values
-
UPLOAD_RESOURCE
public static final String UPLOAD_RESOURCE
- See Also:
- Constant Field Values
-
MASTER
public static final String MASTER
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static final AdminUserSecurity getInstance()
-
haveRight
public boolean haveRight(User user, Collection<String> rights)
return true if user have one of all right. TODO: method not tested.- Parameters:
user
-right
-- Returns:
-
haveRight
public boolean haveRight(User user, String... inRights)
check right (admin have all right)- Parameters:
user
-right
-- Returns:
-
isViewOnly
public boolean isViewOnly(User user)
-
isAdmin
public boolean isAdmin(User user)
return true if user have no restriction- Parameters:
user
-- Returns:
-
isGod
public boolean isGod(User user)
return true if user have no restriction on all website- Parameters:
user
-- Returns:
-
isMaster
public boolean isMaster(User user)
-
canModifyConponent
public final boolean canModifyConponent(ContentContext ctx, String compId) throws Exception
- Throws:
Exception
-
isCurrentUserCanUpload
public static boolean isCurrentUserCanUpload(ContentContext ctx)
-
canModifyPage
public static boolean canModifyPage(ContentContext ctx, MenuElement page, boolean createMessage) throws Exception
check if the currentPage is editable by current user.- Parameters:
ctx
-- Returns:
- Throws:
Exception
-
-