Menu

#64 Problem while deleting a user/group attached to a role

2.2
closed
None
5
2014-07-02
2014-02-10
No

There is a problem when deleting a user or a group that is still attached to a role.
The user or the group is properly deleted but its not deleted from the role XML file.

Discussion

  • Mathieu Gond

    Mathieu Gond - 2014-02-10

    In order to correct the bug you need to upgrade SITools to the last version available on Github or follow the steps below :

    Remove the final of the doInit() method in the class AbstractRoleResource

    Add the following lines in the createInboutRoot createInboundRoot method of RoleApplication just before NotifierFilter filter = new NotifierFilter(getContext());

    router.attach("/users/notify/{userId}", RoleNotifyUserResource.class);
    router.attach("/groups/notify/{groupId}", RoleNotifyGroupResource.class);
    

    Add 2 new classes RoleNotifyUserResource et RoleNotifyGroupResource (in attached zip file)

    Add the following lines In the Starter class after appManager.attachApplication(roleApplication);

    component.getInternalRouter().attach(settings.getString(Consts.APP_ROLES_URL),     roleApplication);
    

    Add the following lines in the GroupTrigger class just before realm.removeGroup(groupName);

    // remove group from the roles
    String url = settings.getString(Consts.APP_ROLES_URL) + "/groups/notify/" + groupName;
    RIAPUtils.handle(url, new EmptyRepresentation(), Method.PUT,     MediaType.APPLICATION_JAVA_OBJECT, getContext());
    

    Add in the UserTrigger class just before realm.removeUser(userId);

    // remove user from the roles
    String url = settings.getString(Consts.APP_ROLES_URL) + "/users/notify/" + userId;
    RIAPUtils.handle(url, new EmptyRepresentation(), Method.PUT,     MediaType.APPLICATION_JAVA_OBJECT, getContext());
    
     
  • Mathieu Gond

    Mathieu Gond - 2014-07-02
    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB