Minro change, added global to user specific cascading
This commit is contained in:
+4
-2
@@ -112,7 +112,6 @@ class AuthorizationsCollector implements IAuthorizator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean canDoOperation(String topic, Authorization.Permission permission, String username) {
|
private boolean canDoOperation(String topic, Authorization.Permission permission, String username) {
|
||||||
if (username == null || username.isEmpty()) {
|
|
||||||
for (Authorization auth : m_globalAuthorizations) {
|
for (Authorization auth : m_globalAuthorizations) {
|
||||||
if (auth.permission == permission || auth.permission == READWRITE) {
|
if (auth.permission == permission || auth.permission == READWRITE) {
|
||||||
if (SubscriptionsStore.matchTopics(topic, auth.topic)) {
|
if (SubscriptionsStore.matchTopics(topic, auth.topic)) {
|
||||||
@@ -120,7 +119,9 @@ class AuthorizationsCollector implements IAuthorizator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (m_userAuthorizations.containsKey(username)) {
|
|
||||||
|
if (username != null && !username.isEmpty()) {
|
||||||
|
if (m_userAuthorizations.containsKey(username)) {
|
||||||
for (Authorization auth : m_userAuthorizations.get(username)) {
|
for (Authorization auth : m_userAuthorizations.get(username)) {
|
||||||
if (auth.permission == permission || auth.permission == READWRITE) {
|
if (auth.permission == permission || auth.permission == READWRITE) {
|
||||||
if (SubscriptionsStore.matchTopics(topic, auth.topic)) {
|
if (SubscriptionsStore.matchTopics(topic, auth.topic)) {
|
||||||
@@ -129,6 +130,7 @@ class AuthorizationsCollector implements IAuthorizator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user