|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.stratelia.webactiv.organization.Table<UserRoleRow>
com.stratelia.webactiv.organization.UserRoleTable
public class UserRoleTable
A UserRoleTable object manages the ST_UserRole table.
Constructor Summary | |
---|---|
UserRoleTable(OrganizationSchema organization)
|
Method Summary | |
---|---|
void |
addGroupInUserRole(int groupId,
int userRoleId)
Adds a group in a userRole. |
void |
addUserInUserRole(int userId,
int userRoleId)
Add an user in a userRole. |
void |
createUserRole(UserRoleRow userRole)
Inserts in the database a new userRole row. |
protected UserRoleRow |
fetchRow(ResultSet rs)
Fetch the current userRole row from a resultSet. |
protected UserRoleRow |
fetchUserRole(ResultSet rs)
Fetch the current userRole row from a resultSet. |
String[] |
getAllObjectUserRoleIdsOfInstance(int instanceId)
|
String[] |
getAllUserRoleIdsOfInstance(int instanceId)
Returns all the UserRole ids of an instance. |
String[] |
getAllUserRoleIdsOfObject(int objectId,
String objectType,
int instanceId)
Returns all the UserRole ids of an object in a given instance. |
UserRoleRow[] |
getAllUserRolesOfInstance(int instanceId)
Returns all the UserRoles of an instance. |
UserRoleRow[] |
getDirectUserRolesOfGroup(int groupId)
Returns all the direct UserRoles of a group. |
UserRoleRow[] |
getDirectUserRolesOfUser(int userId)
Returns all the direct UserRoles of user. |
UserRoleRow |
getUserRole(int id)
Returns the UserRole whith the given id. |
UserRoleRow |
getUserRole(int instanceId,
String roleName,
int inherited)
Returns the UserRole whith the given roleName in the given instance. |
boolean |
isGroupDirectlyInRole(int groupId,
int userRoleId)
Tests if a group has a given role (not recursive). |
boolean |
isUserDirectlyInRole(int userId,
int userRoleId)
Tests if a user has a given role (not recursive). |
protected void |
prepareInsert(String insertQuery,
PreparedStatement insert,
UserRoleRow row)
Set all the parameters of the insert PreparedStatement built from the insertQuery in order to insert the given row. |
protected void |
prepareUpdate(String updateQuery,
PreparedStatement update,
UserRoleRow row)
Set all the parameters of the update PreparedStatement built from the updateQuery in order to update the given row. |
void |
removeAllGroupsFromUserRole(int userRoleId)
Removes all groups from a userRole. |
void |
removeAllUsersFromUserRole(int userRoleId)
Removes all users from a userRole. |
void |
removeGroupFromUserRole(int groupId,
int userRoleId)
Removes a group from a userRole. |
void |
removeUserFromUserRole(int userId,
int userRoleId)
Removes an user from a userRole. |
void |
removeUserRole(int id)
Delete the userRole |
void |
updateUserRole(UserRoleRow userRole)
Update a user role. |
Methods inherited from class com.stratelia.webactiv.organization.Table |
---|
addIdToQuery, addParamToQuery, addParamToQuery, addParamToQuery, aliasColumns, getCount, getCount, getIds, getIds, getIds, getIds, getInteger, getInteger, getMatchingRows, getNextId, getRows, getRows, getRows, getRows, getUniqueRow, getUniqueRow, getUniqueRow, insertRow, performPrepareStatementParams, truncate, updateRelation, updateRelation, updateRelation, updateRow |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UserRoleTable(OrganizationSchema organization)
Method Detail |
---|
protected UserRoleRow fetchUserRole(ResultSet rs) throws SQLException
rs
-
SQLException
public UserRoleRow getUserRole(int id) throws AdminPersistenceException
id
-
AdminPersistenceException
public UserRoleRow getUserRole(int instanceId, String roleName, int inherited) throws AdminPersistenceException
instanceId
- roleName
-
AdminPersistenceException
public UserRoleRow[] getAllUserRolesOfInstance(int instanceId) throws AdminPersistenceException
instanceId
-
AdminPersistenceException
public String[] getAllUserRoleIdsOfInstance(int instanceId) throws AdminPersistenceException
instanceId
-
AdminPersistenceException
public String[] getAllObjectUserRoleIdsOfInstance(int instanceId) throws AdminPersistenceException
AdminPersistenceException
public String[] getAllUserRoleIdsOfObject(int objectId, String objectType, int instanceId) throws AdminPersistenceException
objectId
- objectType
- instanceId
-
AdminPersistenceException
public UserRoleRow[] getDirectUserRolesOfUser(int userId) throws AdminPersistenceException
userId
-
AdminPersistenceException
public UserRoleRow[] getDirectUserRolesOfGroup(int groupId) throws AdminPersistenceException
groupId
-
AdminPersistenceException
public void createUserRole(UserRoleRow userRole) throws AdminPersistenceException
userRole
-
AdminPersistenceException
protected void prepareInsert(String insertQuery, PreparedStatement insert, UserRoleRow row) throws SQLException
Table
prepareInsert
in class Table<UserRoleRow>
SQLException
public void updateUserRole(UserRoleRow userRole) throws AdminPersistenceException
userRole
-
AdminPersistenceException
protected void prepareUpdate(String updateQuery, PreparedStatement update, UserRoleRow row) throws SQLException
Table
prepareUpdate
in class Table<UserRoleRow>
SQLException
public void removeUserRole(int id) throws AdminPersistenceException
id
-
AdminPersistenceException
public boolean isUserDirectlyInRole(int userId, int userRoleId) throws AdminPersistenceException
userId
- userRoleId
-
AdminPersistenceException
public void addUserInUserRole(int userId, int userRoleId) throws AdminPersistenceException
userId
- userRoleId
-
AdminPersistenceException
public void removeUserFromUserRole(int userId, int userRoleId) throws AdminPersistenceException
userId
- userRoleId
-
AdminPersistenceException
public void removeAllUsersFromUserRole(int userRoleId) throws AdminPersistenceException
userRoleId
-
AdminPersistenceException
public void removeAllGroupsFromUserRole(int userRoleId) throws AdminPersistenceException
userRoleId
-
AdminPersistenceException
public boolean isGroupDirectlyInRole(int groupId, int userRoleId) throws AdminPersistenceException
groupId
- userRoleId
-
AdminPersistenceException
public void addGroupInUserRole(int groupId, int userRoleId) throws AdminPersistenceException
groupId
- userRoleId
-
AdminPersistenceException
public void removeGroupFromUserRole(int groupId, int userRoleId) throws AdminPersistenceException
groupId
- userRoleId
-
AdminPersistenceException
protected UserRoleRow fetchRow(ResultSet rs) throws SQLException
fetchRow
in class Table<UserRoleRow>
SQLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |