Skip to content

Commit

Permalink
Fixes after code review
Browse files Browse the repository at this point in the history
  • Loading branch information
npomaroli committed Oct 7, 2022
1 parent 7ed732c commit f8978f1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
import com.gentics.mesh.rest.InternalEndpointRoute;
import com.gentics.mesh.router.route.AbstractInternalEndpoint;

/**
* Abstract endpoint implementation with methods that add routes for getting/granting/revoking role permissions
*/
public abstract class RolePermissionHandlingEndpoint extends AbstractInternalEndpoint {

protected RolePermissionHandlingEndpoint(String basePath, MeshAuthChainImpl chain) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
import com.gentics.mesh.rest.InternalEndpointRoute;
import com.gentics.mesh.router.route.AbstractProjectEndpoint;

/**
* Abstract endpoint implementation with methods that add routes for getting/granting/revoking role permissions
*/
public abstract class RolePermissionHandlingProjectEndpoint extends AbstractProjectEndpoint {

protected RolePermissionHandlingProjectEndpoint(String basePath, MeshAuthChainImpl chain,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ public boolean revokeRolePermissions(Set<HibRole> roles, HibBaseElement element,
if (allowedRoles != null) {
for (HibRole role : roles) {
permissionRevoked = allowedRoles.remove(role.getUuid()) || permissionRevoked;
vertex.setRoleUuidForPerm(permission, allowedRoles);
}
vertex.setRoleUuidForPerm(permission, allowedRoles);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ public static RoleReference roleRef() {

public static RoleReference roleRef2() {
RoleReference ref = new RoleReference();
ref.setUuid(uuid4());
ref.setUuid(uuid5());
ref.setName("editor");
return ref;
}
Expand Down Expand Up @@ -328,4 +328,8 @@ public static String uuid4() {
return "d84a6f054a3f4ed68a6f054a3f1ed635";
}

public static String uuid5() {
return "01ed2f8647421b2b85891e5204d53f1b";
}

}

0 comments on commit f8978f1

Please sign in to comment.