Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Index: dataset and file object cards are not shown when role assigned to explicit groups, works with shib groups #3055

Closed
kcondon opened this issue Apr 1, 2016 · 10 comments

Comments

@kcondon
Copy link
Contributor

kcondon commented Apr 1, 2016

Affects explicit groups, works with shib groups:

  1. assign admin role to published dv that has an unpublished ds with 2 files.
  2. see dv card on homepage view and on my data but do not see ds or files.
  3. if assign admin role to indvidual user, shib or builtin, see dv, ds, and files.

Update:
Also assigning role to a group directly to an unpublished dataset does not show the dataset card at all.
Granting access to restricted file also does not work with an explicit group, works in my data.

This issue exists in v4.3.
@pdurbin Any chance you can take a quick look to see whether it is a simple fix or something requiring more thought?

@kcondon kcondon changed the title Index: Child objects are not indexed when role assigned to groups. Index: Child objects are not indexed when role assigned to explicit groups, works with shib groups Apr 1, 2016
@kcondon kcondon changed the title Index: Child objects are not indexed when role assigned to explicit groups, works with shib groups Index: dataset and file objects are not indexed when role assigned to explicit groups, works with shib groups Apr 1, 2016
@pdurbin
Copy link
Member

pdurbin commented Apr 4, 2016

Potential fix but need to make this roleAssigneeService.getUserGroups method by @sekmiller public and see what @michbarsinai thinks:

    logger.info("BEGIN finding explicit groups for " + user.getIdentifier());
    List<String> explicitGroups = roleAssigneeService.getUserGroups(user.getIdentifier().substring(1));
    for (String string : explicitGroups) {
        logger.info("found explicit group: " + string);
        sb.append(" OR ");
        sb.append(IndexServiceBean.getGroupPrefix() + string);
        groupsFromProviders = sb.toString();
    }
    logger.info("END finding explicit groups for " + user.getIdentifier());

All this would go after calling Set<Group> groups = groupService.groupsFor(au, groupsForDvObjectParamCurrentDataverse); in SearchServiceBean: https://github.com/IQSS/dataverse/blob/v4.3/src/main/java/edu/harvard/iq/dataverse/search/SearchServiceBean.java#L851

@michbarsinai I'm wondering if we can have a groupService.groupsFor(au) method where we get back all the user's groups, without having to pass in a dataverse like the method above.

@sekmiller
Copy link
Contributor

@pdurbin If you pass groupService.groupsFor(au, null) you get all groups assigned to the authenticated user. I used the method that way for shib/ip groups.

@michbarsinai
Copy link
Member

We could, but note that ExplicitGroups are defined in a context of a Dataverse. So you would not get ALL the groups.

On 4 Apr 2016, at 23:47, Philip Durbin notifications@github.com wrote:

Potential fix but need to make this roleAssigneeService.getUserGroups method by @sekmiller https://github.com/sekmiller public and see what @michbarsinai https://github.com/michbarsinai thinks:

logger.info("BEGIN finding explicit groups for " + user.getIdentifier());
List<String> explicitGroups = roleAssigneeService.getUserGroups(user.getIdentifier().substring(1));
for (String string : explicitGroups) {
    logger.info("found explicit group: " + string);
    sb.append(" OR ");
    sb.append(IndexServiceBean.getGroupPrefix() + string);
    groupsFromProviders = sb.toString();
}
logger.info("END finding explicit groups for " + user.getIdentifier());

All this would go after calling Set groups = groupService.groupsFor(au, groupsForDvObjectParamCurrentDataverse); in SearchServiceBean: https://github.com/IQSS/dataverse/blob/v4.3/src/main/java/edu/harvard/iq/dataverse/search/SearchServiceBean.java#L851 https://github.com/IQSS/dataverse/blob/v4.3/src/main/java/edu/harvard/iq/dataverse/search/SearchServiceBean.java#L851
@michbarsinai https://github.com/michbarsinai I'm wondering if we can have a groupService.groupsFor(au) method where we get back all the user's groups, without having to pass in a dataverse like the method above.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub #3055 (comment)

@sekmiller
Copy link
Contributor

But it would work for shib/ip groups since they are not in the context of a dv?

@michbarsinai
Copy link
Member

Shib should be there. IP groups won't, since they are determined by the IP address of the DataverseQuery.

On 4 Apr 2016, at 23:57, Stephen Kraffmiller notifications@github.com wrote:

But it would work for shib/ip groups since they are not in the context of a dv?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub #3055 (comment)

@pdurbin pdurbin self-assigned this Apr 5, 2016
@pdurbin pdurbin changed the title Index: dataset and file objects are not indexed when role assigned to explicit groups, works with shib groups Index: dataset and file object cards are not shown when role assigned to explicit groups, works with shib groups Apr 5, 2016
@pdurbin
Copy link
Member

pdurbin commented Apr 5, 2016

@michbarsinai @sekmiller @scolapasta I implemented a fix in pull request #3062. Code review is very welcome!

I'm passing this issue to QA.

@pdurbin pdurbin assigned kcondon and unassigned pdurbin Apr 5, 2016
@kcondon
Copy link
Contributor Author

kcondon commented Apr 5, 2016

This works now, closing.

@kcondon kcondon closed this as completed Apr 5, 2016
@pdurbin
Copy link
Member

pdurbin commented May 13, 2016

Pull request #3062 now has merge conflicts. Reopening this issue and giving to @scolapasta for prioritization.

@pdurbin pdurbin reopened this May 13, 2016
@pdurbin pdurbin assigned scolapasta and unassigned kcondon May 13, 2016
@scolapasta scolapasta assigned pdurbin and unassigned scolapasta May 13, 2016
pdurbin added a commit that referenced this issue May 16, 2016
Conflicts:
src/main/java/edu/harvard/iq/dataverse/RoleAssigneeServiceBean.java

Here are the changes I had to make:

- Make RoleAssigneeServiceBean.getUserExplicitGroups public.
- Stop using old getUserGroups name.

Also, SearchIT better reflects reality in terms of which tests can run
successfully at this time.
@pdurbin
Copy link
Member

pdurbin commented May 17, 2016

I resolved the merge conflicts in pull request #3062 and updated the branch to include the fix I made in pull request #3124 which resolves the user id mismatch mystery. Passing to QA.

@pdurbin pdurbin assigned kcondon and unassigned pdurbin May 17, 2016
@pdurbin
Copy link
Member

pdurbin commented May 17, 2016

To be clear, the fix is in pull request #3062 which is the 3055-get-more-groups branch.

scolapasta added a commit that referenced this issue May 17, 2016
add groupsFor(AuthenticatedUser au) method #3055
@kcondon kcondon closed this as completed Jul 19, 2016
@pdurbin pdurbin added this to the 4.4 milestone Jul 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants