Skip to content

Conversation

@jcabrerizo
Copy link
Contributor

Now shows the messages from the entitlement control system

Copy link
Member

@tbouron tbouron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jcabrerizo, just have one small comment but LGTM otherwise.
Can be merged after that.

vm.entity.name = vm.name;
}).catch((error)=> {
brSnackbar.create('Cannot update entity name: the entity [' + entityId + '] is undefined');
if(error.data && error.data.error === 403){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need this change as 403 errors are now handled by the Java securityproviser you did @jcabrerizo ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The security provider manages the authentication, but an authenticated user can try execute actions that need an entitlement that s/he hasn't. In this case, the exception thrown send an 403 as status. I tried to left the previous behavior and also manage the unauthorized action. If it doesn't make sense for you @tbouron i can change it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point about the REST API. But using your argument, it should then be applied to all endpoints, not just this one. I think it can be done globally though, like an interceptor of some kind, but it is outside on the scope of this PR IMO.

So I would remove it for now, but create a JIRA ticket to track this task. How does it sound @jcabrerizo ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed the get the message from the error object

Copy link
Member

@tbouron tbouron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks @jcabrerizo 🎉

@tbouron tbouron merged commit 560f5ac into apache:master Mar 29, 2019
@jcabrerizo jcabrerizo deleted the fixEntitlementMSGs branch March 29, 2019 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants