提交 88f4d9dc 编写于 作者: S Serge Rider

PG permissions read fix (NPEs, empty roles name)


Former-commit-id: d6220ced
上级 d91c3bec
......@@ -76,9 +76,13 @@ public class PostgreCommandGrantPrivilege extends DBECommandAbstract<PostgrePerm
roleName = DBUtils.getQuotedIdentifier(object);
objectName = ((PostgreRolePermission)permission).getFullObjectName();
} else {
roleName = DBUtils.getQuotedIdentifier(object.getDataSource(), ((PostgreObjectPermission) permission).getGrantee());
PostgreObjectPermission permission = (PostgreObjectPermission) this.permission;
roleName = permission.getGrantee() == null ? null : DBUtils.getQuotedIdentifier(object.getDataSource(), permission.getGrantee());
objectName = PostgreUtils.getObjectUniqueName(object);
}
if (roleName == null) {
return new DBEPersistAction[0];
}
String objectType;
if (permission instanceof PostgreRolePermission) {
......
......@@ -42,7 +42,7 @@ public class PostgreObjectPermission extends PostgrePermission {
@Property(viewable = true, order = 1)
@NotNull
public String getName() {
return DBUtils.getQuotedIdentifier(getDataSource(), grantee);
return grantee == null ? "": DBUtils.getQuotedIdentifier(getDataSource(), grantee);
}
@Override
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册