如何查找identity.attributes中存在的所有属性?
var context = $evaluation.getContext();
var permission = $evaluation.getPermission();
var resource = permission.getResource();
var identity = context.getIdentity();
print(identity.attributes)
if (identity.id == resource.owner) {
$evaluation.grant();
}
答案 0 :(得分:1)
尝试添加此内容:
var attributes = identity.getAttributes();
print('user attributes: ' + attributes.toMap().keySet());