...
Code Block | ||
---|---|---|
| ||
interface PermissionsService { Set<Permission> getPermissionsForUser(String appId, String userId); Permission addPermission(Permission permission); void updatePermission(Permission permission); void removePermission(Permission permissionspermission); Set<Permission> getPermissionsForType(String appId, PermissionType type, String id); // this delete may not be cascaded by the database and would then // need to be done manually. void deletePermissions(String appId, PermissionType type, String id); /** Spring security will need a very focused method to check, for a * given user and a given object, does the user have any of the required * roles to perform the request. This method can fudge things like * app-scoped permissions, too. */ boolean isAuthorizedAs(AccountId accountId, PermissionType type, String objectId, Role... roles); } |
...