-
Notifications
You must be signed in to change notification settings - Fork 143
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
Fix no corresponding backend roles user can update model issue #909
Fix no corresponding backend roles user can update model issue #909
Conversation
Signed-off-by: Zan Niu <[email protected]>
if (hasAccessControlChange(input) && !modelAccessControlHelper.isOwner(mlModelGroup.getOwner(), user)) { | ||
throw new IllegalArgumentException("Only owner has valid privilege to perform update access control data"); | ||
if (hasAccessControlChange(input)) { | ||
if (!modelAccessControlHelper.isOwner(mlModelGroup.getOwner(), user)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also consider admin?
…check Signed-off-by: Zan Niu <[email protected]>
Signed-off-by: Zan Niu <[email protected]>
…ccess identifier to model access mode Signed-off-by: Zan Niu <[email protected]>
} else if ((ModelAccessIdentifier.PUBLIC == modelAccessIdentifier || ModelAccessIdentifier.PRIVATE == modelAccessIdentifier) | ||
if (modelAccessMode == null) { | ||
if (!Boolean.TRUE.equals(isAddAllBackendRoles) && CollectionUtils.isEmpty(input.getBackendRoles())) { | ||
throw new IllegalArgumentException("User must specify at least one backend role or make the model public/private"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we do not specify any access fields, the default should be private actually, not throw exception
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think let user aware of this need more time, explicitly specify the model mode to private would be easy to understand and less confuse to user, let's make this explicit, if there's callout from user, we can change the behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah should be fine then
…earch-project#909) * Fix no corresponding backend roles user can update model issue Signed-off-by: Zan Niu <[email protected]> * Remove private model check and merge this case into has backend role check Signed-off-by: Zan Niu <[email protected]> * Add admin check for access control change to make admin pass Signed-off-by: Zan Niu <[email protected]> * Change model access mode not mandatory in registering, rename model access identifier to model access mode Signed-off-by: Zan Niu <[email protected]> --------- Signed-off-by: Zan Niu <[email protected]>
…earch-project#909) * Fix no corresponding backend roles user can update model issue Signed-off-by: Zan Niu <[email protected]> * Remove private model check and merge this case into has backend role check Signed-off-by: Zan Niu <[email protected]> * Add admin check for access control change to make admin pass Signed-off-by: Zan Niu <[email protected]> * Change model access mode not mandatory in registering, rename model access identifier to model access mode Signed-off-by: Zan Niu <[email protected]> --------- Signed-off-by: Zan Niu <[email protected]> Signed-off-by: Sicheng Song <[email protected]>
Description
[Describe what this change achieves]
Issues Resolved
[List any issues this PR will resolve]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.