@Test public void hasPermission_checkNotRelevant() { try { cut.hasPermission(null, of(ReferenceType.APPLICATION, APPLICATION_ID, ORGANIZATION, READ)); } catch (IllegalArgumentException iae) { assertTrue(iae.getMessage().contains("not relevant")); } }
public Single<Boolean> hasPermission(User user, PermissionAcls permissions) { return findMembershipPermissions(user, permissions.referenceStream()) .map(permissions::match); }
PermissionService { public Single<Boolean> hasPermission(User user, PermissionAcls permissions) { return findMembershipPermissions(user, permissions.referenceStream()) .map(permissions::match); } }
PermissionService { public Single<Boolean> hasPermission(User user, PermissionAcls permissions) { return findMembershipPermissions(user, permissions.referenceStream()) .map(permissions::match); } PermissionService(MembershipService membershipService,
                             GroupService groupService,
                             RoleService roleService); }
PermissionService { public Single<Boolean> hasPermission(User user, PermissionAcls permissions) { return findMembershipPermissions(user, permissions.referenceStream()) .map(permissions::match); } PermissionService(MembershipService membershipService,
                             GroupService groupService,
                             RoleService roleService); Single<Map<Permission, Set<Acl>>> findAllPermissions(User user, ReferenceType referenceType, String referenceId); Single<Boolean> hasPermission(User user, PermissionAcls permissions); }
PermissionService { public Single<Boolean> hasPermission(User user, PermissionAcls permissions) { return findMembershipPermissions(user, permissions.referenceStream()) .map(permissions::match); } PermissionService(MembershipService membershipService,
                             GroupService groupService,
                             RoleService roleService); Single<Map<Permission, Set<Acl>>> findAllPermissions(User user, ReferenceType referenceType, String referenceId); Single<Boolean> hasPermission(User user, PermissionAcls permissions);  }