-
Notifications
You must be signed in to change notification settings - Fork 476
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
as a Dataverse administrator, I'd like to be able to use the API to configure the default role assigned to a user creating a dataset #5307
Comments
@pameyer - let's discuss in sprint planning today, interested in the use case and thoughts from the rest of the team. |
The team discussed allowing the role to be changed in the API, and adding the new role to the UI as the selected option. The user would be able to use the UI to select one of the other options. |
@mheppler can you please take a look at what I did in permissions-configure and permissions-manage with respect to custom default contributors' roles. Basically, if there's a custom role I disable the option buttons and display what I can from the custom role (name and description). Thanks! |
Sure, @sekmiller, I can take a look tomorrow. Thanks for the heads up. Are there any database update scripts that I need? Or an API command you can provide me to create the new custom role? |
I've got a custom role API command handy: where
|
@pameyer do we need any guardrails here? Right now I allow you to make any built-in role or custom role that belongs to the dataverse to be set as the dataset creator default role. Should there be any restrictions on the default role? |
@mheppler, for testing I created a custom role by hand, but it looks like Pete has a handy api. |
@sekmiller Other than permissions on the API endpoint, I don't think we need any other guardrails (although I don't know if @scolapasta or others have a different opinion). |
There are permissions (ManageDataversePermissions) on the UpdateDataverseDefaultContributorRoleCommand. |
That sounds reasonable to me - thanks! |
UI looks good, @sekmiller. New role name and description are displayed, as they were entered into the db using Pete's json and curl command above. (Had a few hiccups along the way related to the roles permssions, but once I was sorted out, it displayed in the properly.) |
@pameyer after talking with Gustavo he said it would make sense to limit the roles to those with permissions on datasets, so I implemented that. That logic, though doesn't allow the new api to change the default contributors role to the example you mentioned above, because AddDataset is a dataverse role not a dataset role. Could you use something like "viewUnpublished"? |
Exception thrown when create a dataset with inherited role none: Local Exception Stack: |
@kcondon the error above make me wonder if you ran the following SQL statement from the pull request:
If so, my bad. |
Yes. That needs to be run: ALTER TABLE dataverse ALTER COLUMN defaultcontributorrole_id DROP NOT NULL; I didn't note it in the pull request originally. (I'm so used to changing deployment requirements to NONE.) |
@pdurbin @sekmiller As discussed, I had run that sql statement but the stack trace indicates a different table so another statement is needed. |
I don't think a script is needed; it sounds like it is automatically still trying to create the default role when it is set to null, so just throwing an if around that should work. |
The "Edit Access" configuration option can be used to assign the default role for a user creating a dataset within a dataverse:
It would be preferable if this could be configured by API, and support more than two hard-coded roles (
Contributor
andCurator
).The text was updated successfully, but these errors were encountered: