|
Liferay 6.1.2-ce-ga3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.liferay.portal.service.RoleServiceWrapper
public class RoleServiceWrapper
This class is a wrapper for RoleService
.
RoleService
Constructor Summary | |
---|---|
RoleServiceWrapper(RoleService roleService)
|
Method Summary | |
---|---|
Role |
addRole(String className,
long classPK,
String name,
Map<Locale,String> titleMap,
Map<Locale,String> descriptionMap,
int type,
String subType)
Adds a role. |
Role |
addRole(String name,
Map<Locale,String> titleMap,
Map<Locale,String> descriptionMap,
int type)
Deprecated. addRole(String, long, String, Map, Map, int, String) |
void |
addUserRoles(long userId,
long[] roleIds)
Adds the roles to the user. |
void |
deleteRole(long roleId)
Deletes the role with the primary key and its associated permissions. |
String |
getBeanIdentifier()
Returns the Spring bean ID for this bean. |
List<Role> |
getGroupRoles(long groupId)
Returns all the roles associated with the group. |
Role |
getRole(long roleId)
Returns the role with the primary key. |
Role |
getRole(long companyId,
String name)
Returns the role with the name in the company. |
List<Role> |
getUserGroupGroupRoles(long userId,
long groupId)
Returns all the user's roles within the user group. |
List<Role> |
getUserGroupRoles(long userId,
long groupId)
Returns all the user's roles within the user group. |
List<Role> |
getUserRelatedRoles(long userId,
List<Group> groups)
Returns the union of all the user's roles within the groups. |
List<Role> |
getUserRoles(long userId)
Returns all the roles associated with the user. |
RoleService |
getWrappedRoleService()
Deprecated. Renamed to getWrappedService() |
RoleService |
getWrappedService()
|
boolean |
hasUserRole(long userId,
long companyId,
String name,
boolean inherited)
Returns true if the user is associated with the named
regular role. |
boolean |
hasUserRoles(long userId,
long companyId,
String[] names,
boolean inherited)
Returns true if the user has any one of the named regular
roles. |
void |
setBeanIdentifier(String beanIdentifier)
Sets the Spring bean ID for this bean. |
void |
setWrappedRoleService(RoleService roleService)
Deprecated. Renamed to setWrappedService(com.liferay.portal.service.RoleService) |
void |
setWrappedService(RoleService roleService)
|
void |
unsetUserRoles(long userId,
long[] roleIds)
Removes the matching roles associated with the user. |
Role |
updateRole(long roleId,
String name,
Map<Locale,String> titleMap,
Map<Locale,String> descriptionMap,
String subtype)
Updates the role with the primary key. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RoleServiceWrapper(RoleService roleService)
Method Detail |
---|
public String getBeanIdentifier()
getBeanIdentifier
in interface RoleService
public void setBeanIdentifier(String beanIdentifier)
setBeanIdentifier
in interface RoleService
beanIdentifier
- the Spring bean ID for this beanpublic Role addRole(String className, long classPK, String name, Map<Locale,String> titleMap, Map<Locale,String> descriptionMap, int type, String subType) throws PortalException, SystemException
addRole
in interface RoleService
className
- the name of the class for which the role is createdclassPK
- the primary key of the class for which the role is
created (optionally 0
)name
- the role's nametitleMap
- the role's localized titles (optionally
null
)descriptionMap
- the role's localized descriptions (optionally
null
)type
- the role's type (optionally 0
)subType
- the role's subtype (optionally null
)
PortalException
- if a user with the primary key could not be
found, if the user did not have permission to add roles, if the
class name or the role name were invalid, or if the role is a
duplicate
SystemException
- if a system exception occurredpublic Role addRole(String name, Map<Locale,String> titleMap, Map<Locale,String> descriptionMap, int type) throws PortalException, SystemException
addRole(String, long, String, Map, Map, int, String)
addRole
in interface RoleService
name
- the role's nametitleMap
- the role's localized titles (optionally
null
)descriptionMap
- the role's localized descriptions (optionally
null
)type
- the role's type (optionally 0
)
PortalException
- if a user with the primary key could not be
found, if the user did not have permission to add roles, if
the class name or the role name were invalid, or if the role
is a duplicate
SystemException
- if a system exception occurredpublic void addUserRoles(long userId, long[] roleIds) throws PortalException, SystemException
addUserRoles
in interface RoleService
userId
- the primary key of the userroleIds
- the primary keys of the roles
PortalException
- if a user with the primary key could not be found
or if the user did not have permission to assign members to one
of the roles
SystemException
- if a system exception occurredpublic void deleteRole(long roleId) throws PortalException, SystemException
deleteRole
in interface RoleService
roleId
- the primary key of the role
PortalException
- if the user did not have permission to delete the
role, if a role with the primary key could not be found, if the
role is a default system role, or if the role's resource could
not be found
SystemException
- if a system exception occurredpublic List<Role> getGroupRoles(long groupId) throws PortalException, SystemException
getGroupRoles
in interface RoleService
groupId
- the primary key of the group
PortalException
- if a portal exception occurred
SystemException
- if a system exception occurredpublic Role getRole(long roleId) throws PortalException, SystemException
getRole
in interface RoleService
roleId
- the primary key of the role
PortalException
- if a role with the primary key could not be found
or if the user did not have permission to view the role
SystemException
- if a system exception occurredpublic Role getRole(long companyId, String name) throws PortalException, SystemException
The method searches the system roles map first for default roles. If a role with the name is not found, then the method will query the database.
getRole
in interface RoleService
companyId
- the primary key of the companyname
- the role's name
PortalException
- if a role with the name could not be found in the
company or if the user did not have permission to view the role
SystemException
- if a system exception occurredpublic List<Role> getUserGroupGroupRoles(long userId, long groupId) throws PortalException, SystemException
getUserGroupGroupRoles
in interface RoleService
userId
- the primary key of the usergroupId
- the primary key of the group
PortalException
- if a portal exception occurred
SystemException
- if a system exception occurredpublic List<Role> getUserGroupRoles(long userId, long groupId) throws PortalException, SystemException
getUserGroupRoles
in interface RoleService
userId
- the primary key of the usergroupId
- the primary key of the group
PortalException
- if a portal exception occurred
SystemException
- if a system exception occurredpublic List<Role> getUserRelatedRoles(long userId, List<Group> groups) throws PortalException, SystemException
getUserRelatedRoles
in interface RoleService
userId
- the primary key of the usergroups
- the groups (optionally null
)
PortalException
- if a portal exception occurred
SystemException
- if a system exception occurredpublic List<Role> getUserRoles(long userId) throws PortalException, SystemException
getUserRoles
in interface RoleService
userId
- the primary key of the user
PortalException
- if a portal exception occurred
SystemException
- if a system exception occurredpublic boolean hasUserRole(long userId, long companyId, String name, boolean inherited) throws PortalException, SystemException
true
if the user is associated with the named
regular role.
hasUserRole
in interface RoleService
userId
- the primary key of the usercompanyId
- the primary key of the companyname
- the name of the roleinherited
- whether to include the user's inherited roles in the
search
true
if the user is associated with the regular
role; false
otherwise
PortalException
- if a role with the name could not be found in the
company or if a default user for the company could not be found
SystemException
- if a system exception occurredpublic boolean hasUserRoles(long userId, long companyId, String[] names, boolean inherited) throws PortalException, SystemException
true
if the user has any one of the named regular
roles.
hasUserRoles
in interface RoleService
userId
- the primary key of the usercompanyId
- the primary key of the companynames
- the names of the rolesinherited
- whether to include the user's inherited roles in the
search
true
if the user has any one of the regular roles;
false
otherwise
PortalException
- if any one of the roles with the names could not
be found in the company or if the default user for the company
could not be found
SystemException
- if a system exception occurredpublic void unsetUserRoles(long userId, long[] roleIds) throws PortalException, SystemException
unsetUserRoles
in interface RoleService
userId
- the primary key of the userroleIds
- the primary keys of the roles
PortalException
- if a user with the primary key could not be
found, if the user did not have permission to remove members from
a role, or if a role with any one of the primary keys could not
be found
SystemException
- if a system exception occurredpublic Role updateRole(long roleId, String name, Map<Locale,String> titleMap, Map<Locale,String> descriptionMap, String subtype) throws PortalException, SystemException
updateRole
in interface RoleService
roleId
- the primary key of the rolename
- the role's new nametitleMap
- the new localized titles (optionally null
)
to replace those existing for the roledescriptionMap
- the new localized descriptions (optionally
null
) to replace those existing for the rolesubtype
- the role's new subtype (optionally null
)
PortalException
- if the user did not have permission to update the
role, if a role with the primary could not be found, or if the
role's name was invalid
SystemException
- if a system exception occurredpublic RoleService getWrappedRoleService()
getWrappedService()
public void setWrappedRoleService(RoleService roleService)
setWrappedService(com.liferay.portal.service.RoleService)
public RoleService getWrappedService()
getWrappedService
in interface ServiceWrapper<RoleService>
public void setWrappedService(RoleService roleService)
setWrappedService
in interface ServiceWrapper<RoleService>
|
Liferay 6.1.2-ce-ga3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |