public class UserClientSetting extends Setting
Modifier and Type | Field and Description |
---|---|
private static QueryRuntimeFilter |
CLIENT_RUNTIME_FILTER
This filter will only return items if the logged in user has
generic read permission to clients.
|
static Item |
TYPE
The type of item represented by this class.
|
private static QueryRuntimeFilter |
USER_RUNTIME_FILTER
This filter will only return items if the logged in user has
generic read permission to users.
|
private static QueryRuntimeFilter |
USERCLIENT_RUNTIME_FILTER
This filter will only return items if the logged in user has
generic read permission to users and clients.
|
MAX_NAME_LENGTH, MAX_VALUE_LENGTH
Constructor and Description |
---|
UserClientSetting(UserClientSettingData data) |
Modifier and Type | Method and Description |
---|---|
static UserClientSetting |
getById(DbControl dc,
int id)
Get a
UserClientSetting item when you know the ID. |
Client |
getClient()
Get the client application this setting is valid for.
|
(package private) UserClientSettingData |
getData()
Get the
BasicData object that holds all data for this item. |
static UserClientSetting |
getNew(DbControl dc,
User user,
Client client,
String name,
String value)
Create a new
UserClientSetting item. |
static ItemQuery<UserClientSetting> |
getQuery(User user,
Client client)
Get a query configured to retrieve client specific settings for a user.
|
Item |
getType()
Get the type of item represented by the object.
|
User |
getUser()
Get the user this setting is valid for.
|
(package private) void |
initPermissions(int granted,
int denied)
READ permission is granted if the logged in user is the owner of this
setting.
|
(package private) void |
setClient(Client client)
Set the client application this setting is valid for.
|
(package private) void |
setUser(User user)
Set the user this setting is valid for.
|
addAnnotatableParents, addUsingItems, addUsingItems, checkPermission, equals, getBasicData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getUsingItems, getVersion, hashCode, hasPermission, isDetached, isInDatabase, isUsed, onAfterCommit, onAfterInsert, onBeforeCommit, onRollback, setDbControl, setProjectDefaults, toString, validate
public static final Item TYPE
Item.USERCLIENTSETTING
,
getType()
private static final QueryRuntimeFilter CLIENT_RUNTIME_FILTER
private static final QueryRuntimeFilter USER_RUNTIME_FILTER
private static final QueryRuntimeFilter USERCLIENT_RUNTIME_FILTER
UserClientSetting(UserClientSettingData data)
public static UserClientSetting getNew(DbControl dc, User user, Client client, String name, String value) throws BaseException
UserClientSetting
item.dc
- The DbControl
which will be used for
permission checking and database accessuser
- The User
which this should be a setting forclient
- The Client
which this should be a setting forname
- The name of the settingvalue
- The value of the settingUserClientSetting
itemBaseException
- If there is an errorpublic static UserClientSetting getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
UserClientSetting
item when you know the ID.dc
- The DbControl
which will be used for
permission checking and database access.id
- The ID of the item to loadUserClientSetting
itemItemNotFoundException
- If an item with the specified
ID is not foundPermissionDeniedException
- If the logged in user doesn't
have Permission.READ
permission to the itemBaseException
- If there is another errorpublic static ItemQuery<UserClientSetting> getQuery(User user, Client client)
user
- The user to retreive settings for, null is allowed if
the logged in user has generic READ permission for all users in which case
all settings will be returnedclient
- The client to retreive settings for, null is allowed if
the logged in user has generic READ permission for all clients in which case
all settings will be returnedItemQuery
objectUserClientSettingData getData()
BasicItem
BasicData
object that holds all data for this item.public Item getType()
Identifiable
Item
enumeration.void initPermissions(int granted, int denied) throws BaseException
initPermissions
in class Setting
granted
- Permissions that have been granted by the subclassdenied
- Permissions that have been denied by the subclassBaseException
- If the permissions couldn't be initialisedpublic User getUser() throws PermissionDeniedException, BaseException
User
itemPermissionDeniedException
- If the logged in user doesn't have
Permission.READ
permissionBaseException
- If there is another errorvoid setUser(User user) throws PermissionDeniedException, InvalidDataException
InvalidDataException
- If the user is nullPermissionDeniedException
public Client getClient() throws PermissionDeniedException, BaseException
Client
itemPermissionDeniedException
- If the logged in user doesn't have
Permission.READ
permissionBaseException
- If there is another errorvoid setClient(Client client) throws PermissionDeniedException, InvalidDataException
InvalidDataException
- If the client is nullPermissionDeniedException