Package org.sakaiproject.api.privacy
Interface PrivacyManager
-
public interface PrivacyManagerPrivacyManager maintains and queries user privacy settings
An implementation can modify the behavior of the Privacy Service within sakai.properties: privacy.manager.defaultViewable=true|false a 'true' value will set privacy enabled for a user whose privacy settings are unknown a 'false' value will set privacy disabled for a user whose privacy settings are unknown If this value is not set, the default behavior will be to show users or make them viewable. privacy.manager.overrideViewable=true|false a 'true' value will make all users viewable in the system a 'false' value will make all users hidden in the system Do not set this value for normal operation (non overridden behavior). privacy.manager.userRecordHasPrecedence=true|false a 'true' value indicates that a user record has precedence over a system record a 'false' value indicates that a system record has precedence over a user record
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_PRIVACY_KEYstatic StringHIDDENstatic StringPRIVACY_PREFSstatic StringSYSTEM_RECORD_TYPEstatic StringUSER_RECORD_TYPEstatic StringVISIBLE
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Set<String>findHidden(String contextId, Set<String> userIds)Get a set of users who have privacy enabled within a context.SetfindViewable(String contextId, Set userIds)Get a set of users who have privacy disabled within a context.StringgetDefaultPrivacyState(String userId)SetgetViewableState(String contextId, Boolean value, String recordType)Get the state of the users within the specified context filtered by a Boolean value.MapgetViewableState(String contextId, String recordType)Get the state of the users within the specified context.booleanisViewable(String contextId, String userId)Determine user privacy within the specified context.voidsetDefaultPrivacyState(String userId, String visibility)voidsetViewableState(String contextId, String userId, Boolean value, String recordType)Set user's privacy setting within the specified context given a record type.voidsetViewableState(String contextId, Map userViewableState, String recordType)Set the state for each entry in the userMap.booleanuserMadeSelection(String contextId, String userId)Determine if a user has specifically made a choice.
-
-
-
Field Detail
-
SYSTEM_RECORD_TYPE
static final String SYSTEM_RECORD_TYPE
- See Also:
- Constant Field Values
-
USER_RECORD_TYPE
static final String USER_RECORD_TYPE
- See Also:
- Constant Field Values
-
VISIBLE
static final String VISIBLE
- See Also:
- Constant Field Values
-
HIDDEN
static final String HIDDEN
- See Also:
- Constant Field Values
-
PRIVACY_PREFS
static final String PRIVACY_PREFS
- See Also:
- Constant Field Values
-
DEFAULT_PRIVACY_KEY
static final String DEFAULT_PRIVACY_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
isViewable
boolean isViewable(String contextId, String userId)
Determine user privacy within the specified context.- Parameters:
contextId-userId- (UUID)- Returns:
- true if privacy is enabled for the user, false otherwise
-
userMadeSelection
boolean userMadeSelection(String contextId, String userId)
Determine if a user has specifically made a choice.- Parameters:
contextId-userId- (UUID)- Returns:
- true if user made a privacy decision
-
findViewable
Set findViewable(String contextId, Set userIds)
Get a set of users who have privacy disabled within a context. (Visible)- Parameters:
contextId-userIds-- Returns:
- Set of
org.sakakproject.service.legacy.User.idobjects (UUID)
-
findHidden
Set<String> findHidden(String contextId, Set<String> userIds)
Get a set of users who have privacy enabled within a context. (Hidden)- Parameters:
contextId-userIds-- Returns:
- Set of
org.sakakproject.service.legacy.User.idobjects (UUID)
-
getViewableState
Set getViewableState(String contextId, Boolean value, String recordType)
Get the state of the users within the specified context filtered by a Boolean value. Implementation should delegate to AuthzGroupService to get users from Realm.- Parameters:
contextId-value- filter (True, False, NULL)recordType- is a UUID i.e. (getSystemRecordType(), getUserRecordType())- Returns:
- Set of users who satisfy the criteria
-
getViewableState
Map getViewableState(String contextId, String recordType)
Get the state of the users within the specified context.- Parameters:
contextId-recordType- is a UUID i.e. (getSystemRecordType(), getUserRecordType())- Returns:
- Map {key=userId, value=Boolean}
-
setViewableState
void setViewableState(String contextId, String userId, Boolean value, String recordType)
Set user's privacy setting within the specified context given a record type.- Parameters:
contextId-userId- (UUID)value- using three-valued logic (True, False, NULL)recordType- is a UUID i.e. (getSystemRecordType(), getUserRecordType())
-
setViewableState
void setViewableState(String contextId, Map userViewableState, String recordType)
Set the state for each entry in the userMap.- Parameters:
contextId-userMap- is a Map {key=userId, value=Boolean}recordType- is a UUID i.e. (getSystemRecordType(), getUserRecordType())
-
-