[KEYCLOAK-4901] - New policy mgmt rest api should return specific representations for a policy type
This commit is contained in:
parent
a70cab502c
commit
57d3c44bb7
3 changed files with 9 additions and 2 deletions
|
@ -22,6 +22,8 @@ import java.util.Map;
|
|||
import org.keycloak.authorization.AuthorizationProvider;
|
||||
import org.keycloak.authorization.model.Policy;
|
||||
import org.keycloak.authorization.model.ResourceServer;
|
||||
import org.keycloak.models.utils.ModelToRepresentation;
|
||||
import org.keycloak.representations.idm.authorization.AbstractPolicyRepresentation;
|
||||
import org.keycloak.services.resources.admin.permissions.AdminPermissionEvaluator;
|
||||
import org.keycloak.services.resources.admin.AdminEventBuilder;
|
||||
|
||||
|
@ -56,4 +58,9 @@ public class PermissionService extends PolicyService {
|
|||
filters.put("permission", new String[] {Boolean.TRUE.toString()});
|
||||
return super.doSearch(firstResult, maxResult, filters);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbstractPolicyRepresentation toRepresentation(Policy policy, AuthorizationProvider authorization) {
|
||||
return ModelToRepresentation.toRepresentation(policy, authorization, false, false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,6 +62,6 @@ public class PolicyTypeResourceService extends PolicyResourceService {
|
|||
|
||||
@Override
|
||||
protected AbstractPolicyRepresentation toRepresentation(Policy policy, AuthorizationProvider authorization) {
|
||||
return ModelToRepresentation.toRepresentation(policy, authorization);
|
||||
return ModelToRepresentation.toRepresentation(policy, authorization, false, false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ public class PolicyTypeService extends PolicyService {
|
|||
|
||||
@Override
|
||||
protected AbstractPolicyRepresentation toRepresentation(Policy policy, AuthorizationProvider authorization) {
|
||||
return ModelToRepresentation.toRepresentation(policy, authorization);
|
||||
return ModelToRepresentation.toRepresentation(policy, authorization, false, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue