15 lines
No EOL
414 B
Text
15 lines
No EOL
414 B
Text
package com.photoz.authz.policy.admin
|
|
|
|
import org.keycloak.authorization.policy.evaluation.Evaluation;
|
|
|
|
rule "Authorize Resource Owner"
|
|
dialect "mvel"
|
|
when
|
|
$evaluation : Evaluation(
|
|
$identity: context.identity,
|
|
$permission: permission,
|
|
$permission.resource != null && $permission.resource.owner.equals($identity.id)
|
|
)
|
|
then
|
|
$evaluation.grant();
|
|
end |