|
Lovemore Nalube made changes - 30-Nov-2009 01:15
[
Permlink
| « Hide
]
Aaron Zeckoski added a comment - 30-Nov-2009 01:33
Removing via PUT is not restful, DELETE should be used to remove users from the group
Thanks for the correction Aaron, I agree. So do you think this is something that we can start plugging in?
Sure. You can just add some stuff to the memberships provider to handle it. The easiest may just be to extend the current custom action to include added path params and support for multiple methods. That would probably result in the nicest URL path and least overall code even if it involves a bunch of if-then checks.
I think we also need to be able to create a group that doesn't yet exist, and remove a group.
Lovemore Nalube made changes - 30-Nov-2009 05:49
Proposed URL scheme for updating memberships:
GET /direct/membership/group/groupid - gets current membership for the given groupid (current behaviour) POST /direct/membership/group/groupid - update the membership for the given groupid Parameters for the POST: action=(update|add|remove) followed by list of userids. If update, replace the current membership with the provided list. If add, add the list to the existing membership, if remove, remove the list from the existing membership. We have http methods for a reason. Rather than providing actions we should use PUT, POST, DELETE. This is what they are designed for and this is what is restful.
PUT for add, POST for update, and DELETE for remove would make sense to me. We can have DELETE for removing users like this:
DELETE /direct/membership/group/groupid - delete the membership for the given groupid based on a set of userIds Proposed URL scheme for managing groups (add a new group in a site, delete a group, get and update group metadata):
GET /direct/site/siteid/groups - get a list of groups (group metadata, i.e. title, description) but not membership GET /direct/site/siteid/group/groupid - get metadata for group but not membership POST /direct/site/siteid/group/groupid - update metadata for group but not membership PUT /direct/site/siteid/group/new - create a new group in the site (returns group id). Params include title, description DELETE /direct/site/siteid/group - delete an existing group in the site.
Stephen Marquard made changes - 01-Dec-2009 03:15
Assigning to Lovemore to implement in UCT branch.
Stephen Marquard made changes - 01-Dec-2009 03:16
There are 2 types of groups in a site, viz. those managed by Site Info and those managed by Section Info.
The EB providers here will return info about Section Info-managed groups, but will not allow updates to them (as there are specific business rules that apply to these groups and they must be managed by the Section Manager rather than directly). To be able to tell these apart, the group metadata must include the group properties. Site Info managed groups have the property "group_prop_wsetup_created" = true.
This feature has been added to the UCT branch of Entity Broker. It's been tested and works as expected.
Can we introduce this into trunk?
Lovemore Nalube made changes - 15-Jan-2010 00:55
Aaron Zeckoski made changes - 20-Jan-2010 08:34
Maintenance team review: If this issue is being worked on please take ownership of it by assigning it to yourself. Otherwise it is likely to be closed as an abandoned issue. If this is not being pursued please close the issue.
Anthony Whyte made changes - 25-Jan-2010 06:46
Stephen Marquard made changes - 27-Jan-2010 23:55
role can return null here:
Role role = site.getUserRole(userId); when the user is inactive in the site, as per kernel-impl/src/main/java/org/sakaiproject/authz/impl/BaseAuthzGroup.java: public Role getUserRole(String user) { if (m_lazy) baseAuthzGroupService.m_storage.completeGet(this); BaseMember grant = (BaseMember) m_userGrants.get(user); if ((grant != null) && (grant.active)) return grant.role; return null; } The EP should not take account of a member's site status, i.e. it should still be possible to update a group, and add or remove an inactive member from a group. The status in the group should be the status in the site on adding. Please adjust to get the role via the Member record which doesn't check for active status, i.e. Member m = site.getMember(userId); Role role = m.getRole(); and avoid all use of getUserRole() QA: inactive users can be added to and removed from groups, group update operations on groups with inactive members complete correctly.
Stephen Marquard made changes - 28-Jan-2010 00:58
Lovemore Nalube made changes - 29-Jan-2010 01:01
Stephen Marquard made changes - 29-Jan-2010 02:06
David Horwitz made changes - 29-Jan-2010 02:08
This patch introduces these features to trunk.
Lovemore Nalube made changes - 01-Feb-2010 23:56
Anthony Whyte made changes - 07-Feb-2010 17:47
Please audit changes in the attached patch for patching trunk.
Lovemore Nalube made changes - 16-Feb-2010 04:31
Note that I accidently committed the changed for this issue under a different JIRA:
commit -m "http://bugs.sakaiproject.org/jira/browse/SAK-18131..." /opt/sakai/entitybroker/core-providers/src/java/membership.properties /opt/sakai/entitybroker/core-providers/src/java/site.properties /opt/sakai/entitybroker/core-providers/src/java/org/sakaiproject/entitybroker/providers/MembershipEntityProvider.java /opt/sakai/entitybroker/core-providers/src/java/org/sakaiproject/entitybroker/providers/ServerConfigEntityProvider.java /opt/sakai/entitybroker/core-providers/src/java/org/sakaiproject/entitybroker/providers/SiteEntityProvider.java Sending /opt/sakai/entitybroker/core-providers/src/java/membership.properties Sending /opt/sakai/entitybroker/core-providers/src/java/org/sakaiproject/entitybroker/providers/MembershipEntityProvider.java Sending /opt/sakai/entitybroker/core-providers/src/java/org/sakaiproject/entitybroker/providers/ServerConfigEntityProvider.java Sending /opt/sakai/entitybroker/core-providers/src/java/org/sakaiproject/entitybroker/providers/SiteEntityProvider.java Sending /opt/sakai/entitybroker/core-providers/src/java/site.properties Transmitting file data ... Committed revision 74580.
Aaron Zeckoski made changes - 12-Mar-2010 09:31
In entitybroker-1.3.x and released as part of entitybroker-1.3.9.
Anthony Whyte made changes - 23-Mar-2010 12:58
Anthony Whyte made changes - 23-Mar-2010 12:58
Anthony Whyte made changes - 24-Mar-2010 10:17
Steve Swinsburg made changes - 08-Apr-2010 04:36
Anthony Whyte made changes - 29-Jun-2010 16:35
Anthony Whyte made changes - 29-Jun-2010 16:56
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||