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

PAYARA-3885 Implement Parameterized dynamically resolved role names #4142

Merged
merged 4 commits into from
Aug 19, 2019
Merged

PAYARA-3885 Implement Parameterized dynamically resolved role names #4142

merged 4 commits into from
Aug 19, 2019

Conversation

jGauravGupta
Copy link
Contributor

@jGauravGupta jGauravGupta commented Aug 12, 2019

Implemented Parameterized dynamically resolved role names feature by using existing annotation @RolesPermitted: e.g

@RolesPermitted("#{'CustomerCare_'.concat(customer.name)}")
public void updateCustomer(@Named("customer") Customer customer){
}

In the above example, Named annotation is used to define the parameter name in dynamic role expression.

Multiple parameters can be used in el expression: e.g

@RolesPermitted("#{self.findRole(customer, product)}")
public void updateCustomer(@Named("customer") Customer customer, @Named("product") Product product){
}

If the parameter name not defined using Named annotation and method parameter count is 1 then default param name is used, e.g

@RolesPermitted("#{'CustomerCare_'.concat(param.name)}")
public void updateCustomer(Customer customer){
}

Testcases: https://github.com/payara/payara-samples/pull/24

@jGauravGupta
Copy link
Contributor Author

jenkins test please

@jGauravGupta jGauravGupta marked this pull request as ready for review August 13, 2019 19:02
Copy link
Contributor

@dmatej dmatej left a comment

Choose a reason for hiding this comment

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

Tests were successful, I have only some comments to the syntax.

Copy link
Contributor

@dmatej dmatej left a comment

Choose a reason for hiding this comment

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

Changing feedback to comment to avoid blocking.

@jGauravGupta
Copy link
Contributor Author

jenkins test please

@Pandrex247 Pandrex247 merged commit 3c8dd87 into payara:master Aug 19, 2019
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.

5 participants