public interface ProjectLogic
| Modifier and Type | Method and Description |
|---|---|
boolean |
addChildrenNodes(Object node,
String userId,
List<ListOptionSerialized> blankRestrictedTools,
boolean onlyAccessNodes,
List<String> accessAdminNodes,
boolean shopping,
boolean shoppingPeriodTool)
Adds children node to a node that hasn't had it's children populated.
|
void |
clearNodeCache()
clears DelegatedAccess's own node cache
|
TreeModel |
createAccessTreeModelForUser(String userId,
boolean addDirectChildren,
boolean cascade)
returns the tree model of a user's delegated access.
|
TreeModel |
createEntireTreeModelForUser(String userId,
boolean addDirectChildren,
boolean cascade)
This returns a full tree model for a user.
|
TreeModel |
createTreeModelForShoppingPeriod(String userId)
returns the tree model that looks up the shopping period information for the sites the user has access to
|
void |
deleteEmptyNonSiteNodes(String hierarchyId)
Deletes empty non sites nodes in a hierarchy (nodes that doesn't start with /site/
and has no children)
|
Set<String> |
filterShoppingPeriodEditNodes(Set<String> nodeIds)
filters out any node id that the user doesn't have permission to modify shopping period settings
|
Set<String> |
filterShoppingPeriodEditNodes(Set<String> nodeIds,
String userId)
filters out any node id that the user doesn't have permission to modify shopping period settings
|
Set<HierarchyNodeSerialized> |
getAccessAdminNodesForUser(String userId)
Returns a set of hierarchy nodes that the user has been assigned accessAdmin privileges for.
|
List<AccessSearchResult> |
getAccessAtLevel(List<String> nodeSelectOrder,
boolean includeLowerPerms)
returns a list of results for every level that is passed in.
|
List<AccessSearchResult> |
getAccessForUser(User user)
returns a list of AccessSearchResult based on the user id
|
String |
getAddDAMyworkspaceJobStatus()
returns the status of the job for adding delegated access tool to user's my workspace.
|
HierarchyNodeSerialized |
getCachedNode(String id)
returns a HierarchyNodeSerialized node
|
Map<String,HierarchyNodeSerialized> |
getCachedNodes(String[] ids)
returns a map of HierarchyNodes
|
String[] |
getCurrentUsersAccessToSite(String siteRef)
This returns an array of {realm, role} for which the user has delegated access to.
|
Set<HierarchyNodeSerialized> |
getDirectNodes(String nodeId)
returns a set of direct children nodes for passed in node id
|
List<ListOptionSerialized> |
getEntireToolsList()
returns a blank (unselected) list of all the tool options for restricting tools
|
TreeModel |
getEntireTreePlusUserPerms(String userId)
This returns the entire tree plus any permissions set for a user
|
Date |
getHierarchyJobLastRunDate(String nodeId)
returns the hierarchyjoblastrundate date for the node Id and hierarchy user
|
Map<String,Set<String>> |
getHierarchySearchOptions(Map<String,String> hierarchySearchMap) |
NodeModel |
getNodeModel(String nodeId,
String userId)
This will return a fully instantiated NodeModel for that user and id.
|
Map<String,List<String>> |
getNodesBySiteRef(String[] siteRef,
String hierarchyId)
Returns a map of {siteRef, nodeId}
|
Map<String,String> |
getRealmRoleDisplay(boolean shopping)
returns a map of all role options and their realm/role ids separated by a ':'.
|
HierarchyNodeSerialized |
getRootNodeId()
returns the root node for DA
|
Map<String,AccessNode> |
getUserAccessForSite(String siteRef)
Returns a map of UserId -> AccessNode
|
boolean |
hasAccessAdminNodes(String userId)
returns whether the user has any "access admin" permission
|
boolean |
hasAllowBecomeUserPerm(String userId)
returns whether the user has any "allowBecomeUser" permission
|
boolean |
hasDelegatedAccessNodes(String userId)
returns whether the user has any delegated access
|
boolean |
hasShoppingPeriodAdminNodes(String userId)
Returns whether the user has any shopping period admin access
|
void |
initializeDelegatedAccessSession()
updates the user's Session adding all of the user's site and role access to the delegatedaccess.accessmap Session attribute.
|
boolean |
isShoppingPeriodOpenForSite(Date startDate,
Date endDate,
String[] nodeAccessRealmRole,
String[] restrictedAuthTools,
String[] restrictedPublicTools)
Call this function to determine if the shopping period is available for a set of settings
|
boolean |
isUserAllowBecomeUser(String userId,
String siteRef)
returns true if the user has site access and has the "allowBecomeUser" permission set for
this site or any of it's parents
|
void |
removeAccess(String nodeId,
String userId,
int accessType)
This will remove access at the node id passed in.
|
void |
removeAllPermsForUser(String userId)
Removes all permissions for a user
|
void |
removeNode(HierarchyNode node)
Removes this node and all permissions and children nodes
|
void |
removeNode(String nodeId)
Removes this node an all permissions and children nodes
|
void |
saveHierarchyJobLastRunDate(Date runDate,
String nodeId)
Saves the date for the last time the hierarchy job ran successfully
|
void |
scheduleAddDAMyworkspaceJobStatus()
Schedules the AddDAMyworkspace job to run immediately
|
List<SearchResult> |
searchUsers(String search)
Returns a list of SearchResults for the user search
|
List<SiteSearchResult> |
searchUserSites(String search,
Map<String,Object> advancedOptions,
boolean shoppingPeriod,
boolean activeShoppingData)
Searches user access sites by siteId and siteTitle and props
|
void |
syncMyworkspaceToolForUser(String userId)
This will ensure the Delegated Access tool is synced with the user's MyWorkspace.
|
void |
updateAddDAMyworkspaceJobStatus(String status)
removes the old status and updates it with the string passed in
|
void |
updateNodePermissionsForUser(DefaultMutableTreeNode node,
String userId)
Removes old user permissions and replaces it with the passed in information.
|
void |
updateNodePermissionsForUser(NodeModel nodeModel,
String userId) |
Map<String,String> |
updateShoppingPeriodSettings(DefaultMutableTreeNode node)
Call this method if you want to update a node and all it's children
it will only update nodes that start with /site/
|
String[] getCurrentUsersAccessToSite(String siteRef)
siteRef - List<SearchResult> searchUsers(String search)
search - first - last - void updateNodePermissionsForUser(DefaultMutableTreeNode node, String userId)
nodeModel - userId - void initializeDelegatedAccessSession()
List<SiteSearchResult> searchUserSites(String search, Map<String,Object> advancedOptions, boolean shoppingPeriod, boolean activeShoppingData)
search - advancedOptions - shoppingPeriod - activeShoppingData - TreeModel createAccessTreeModelForUser(String userId, boolean addDirectChildren, boolean cascade)
userId - addDirectChildren - cascade - TreeModel createEntireTreeModelForUser(String userId, boolean addDirectChildren, boolean cascade)
userId - addDirectChildren - cascade - TreeModel createTreeModelForShoppingPeriod(String userId)
userId - boolean addChildrenNodes(Object node, String userId, List<ListOptionSerialized> blankRestrictedTools, boolean onlyAccessNodes, List<String> accessAdminNodes, boolean shopping, boolean shoppingPeriodTool)
node - userId - blankRestrictedTools - onlyAccessNodes - accessAdminNodes - shopping - shoppingPeriodTool - List<ListOptionSerialized> getEntireToolsList()
NodeModel getNodeModel(String nodeId, String userId)
nodeId - userId - HierarchyNodeSerialized getCachedNode(String id)
id - Map<String,HierarchyNodeSerialized> getCachedNodes(String[] ids)
ids - TreeModel getEntireTreePlusUserPerms(String userId)
userId - boolean hasShoppingPeriodAdminNodes(String userId)
userId - boolean hasDelegatedAccessNodes(String userId)
userId - boolean hasAccessAdminNodes(String userId)
userId - boolean hasAllowBecomeUserPerm(String userId)
userId - Map<String,List<String>> getNodesBySiteRef(String[] siteRef, String hierarchyId)
siteRef - hierarchyId - void saveHierarchyJobLastRunDate(Date runDate, String nodeId)
runDate - nodeId - Date getHierarchyJobLastRunDate(String nodeId)
nodeId - void removeNode(String nodeId)
nodeId - void removeNode(HierarchyNode node)
node - void deleteEmptyNonSiteNodes(String hierarchyId)
hierarchyId - void clearNodeCache()
Map<String,String> getRealmRoleDisplay(boolean shopping)
shopping - Set<HierarchyNodeSerialized> getAccessAdminNodesForUser(String userId)
userId - boolean isShoppingPeriodOpenForSite(Date startDate, Date endDate, String[] nodeAccessRealmRole, String[] restrictedAuthTools, String[] restrictedPublicTools)
startDate - endDate - nodeAccessRealmRole - restrictedAuthTools - restrictedPublicTools - void syncMyworkspaceToolForUser(String userId)
userId - Map<String,AccessNode> getUserAccessForSite(String siteRef)
siteRef - Map<String,String> updateShoppingPeriodSettings(DefaultMutableTreeNode node)
node - String getAddDAMyworkspaceJobStatus()
void updateAddDAMyworkspaceJobStatus(String status)
status - void scheduleAddDAMyworkspaceJobStatus()
boolean isUserAllowBecomeUser(String userId, String siteRef)
userId - siteRef - HierarchyNodeSerialized getRootNodeId()
Set<HierarchyNodeSerialized> getDirectNodes(String nodeId)
nodeId - List<AccessSearchResult> getAccessForUser(User user)
userId - List<AccessSearchResult> getAccessAtLevel(List<String> nodeSelectOrder, boolean includeLowerPerms)
nodeSelectOrder - includeLowerPerms - void removeAccess(String nodeId, String userId, int accessType)
nodeId - userId - accessType - void removeAllPermsForUser(String userId)
userId - Map<String,Set<String>> getHierarchySearchOptions(Map<String,String> hierarchySearchMap)
Set<String> filterShoppingPeriodEditNodes(Set<String> nodeIds)
nodeIds - Copyright © 2003–2016 Sakai Project. All rights reserved.