Skip to content

Commit

Permalink
update act to 1.8.33b; update act-aaa-plugin to 1.9.1; remove ":" fro…
Browse files Browse the repository at this point in the history
…m MorphiaService.QUERY_SEP
  • Loading branch information
greenlaw110 committed Jun 27, 2020
1 parent f9d2413 commit 7c28482
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 8 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# act-morphia CHANGE LOG

1.10.0 27/Jun/2020
* remove ":" from MorphiaService.QUERY_SEP
* update to act-1.8.33b
* update act-aaa-plugin to 1.9.1

1.9.0 04/Mar/2020
* update to act-1.8.32
* Dao.update API - unset the field in database when passed in value is `null` #39
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<artifactId>act-morphia</artifactId>
<packaging>jar</packaging>
<version>1.9.1-SNAPSHOT</version>
<version>1.10.0-SNAPSHOT</version>

<name>ACT Morphia</name>
<description>The Morphia Plugin for Actframework MongoDB access</description>
Expand All @@ -30,7 +30,7 @@
<parent>
<groupId>org.actframework</groupId>
<artifactId>parent</artifactId>
<version>1.8.32</version>
<version>1.8.33b</version>
</parent>

<properties>
Expand All @@ -40,7 +40,7 @@
<morphia.version>1.3.2</morphia.version>
<mongodb-driver.version>3.8.0</mongodb-driver.version>

<act-aaa.version>1.7.0</act-aaa.version>
<act-aaa.version>1.9.1</act-aaa.version>
<act-test.version>0.9.0-BETA-1</act-test.version>
</properties>

Expand Down
24 changes: 20 additions & 4 deletions src/main/java/act/aaa/model/MorphiaUserBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
*/

import act.Act;
import act.aaa.AAAService;
import act.aaa.PasswordVerifier;
import act.aaa.util.AAALookup;
import act.aaa.util.PrivilegeCache;
Expand Down Expand Up @@ -117,6 +118,12 @@ public T grantPermissions(Permission... permissions) {
}

public T grantPermissionByNames(String... permissions) {
AAAService aaaService = aaaService();
for (String perm : permissions) {
if (!aaaService.isValidPermission(perm)) {
throw new IllegalArgumentException("Permission not recognized: " + perm);
}
}
this.permissions = StringTokenSet.merge(this.permissions, permissions);
return me();
}
Expand All @@ -132,8 +139,7 @@ public T grantPermissionByNames(Collection<String> permissions) {
if (permissions.isEmpty()) {
return me();
}
this.permissions = StringTokenSet.merge(C.list(permissions).append(this.permissions));
return me();
return this.grantPermissionByNames(permissions.toArray(new String[]{}));
}

public T grantRoles(Role... roles) {
Expand All @@ -144,6 +150,12 @@ public T grantRoles(Role... roles) {
}

public T grantRoleByNames(String... roles) {
AAAService aaaService = aaaService();
for (String role : roles) {
if (!aaaService.isValidRole(role)) {
throw new IllegalArgumentException("Role not recognized: " + role);
}
}
this.roles = StringTokenSet.merge(this.roles, roles);
return me();
}
Expand All @@ -159,8 +171,7 @@ public T grantRoleByNames(Collection<String> roles) {
if (roles.isEmpty()) {
return me();
}
this.roles = StringTokenSet.merge(C.list(roles).append(this.roles));
return me();
return this.grantRoleByNames(roles.toArray(new String[]{}));
}

@Override
Expand Down Expand Up @@ -220,4 +231,9 @@ private static String stringOf(Iterable<? extends AAAObject> aaaObjects) {
}
return buf.toString();
}

private AAAService aaaService() {
return Act.getInstance(AAAService.class);
}

}
2 changes: 1 addition & 1 deletion src/main/java/act/db/morphia/MorphiaService.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class MorphiaService extends DbService {

public static final Version VERSION = MorphiaPlugin.VERSION;

public static final String QUERY_SEP = "[,;:]+";
public static final String QUERY_SEP = "[,;]+";
public static final String GROUP_SEP = S.COMMON_SEP;

@Stateless
Expand Down

0 comments on commit 7c28482

Please sign in to comment.