Role { public static UnboundRole hostedOperator() { return new UnboundRole(RoleDefinition.hostedOperator); } Role(RoleDefinition roleDefinition, Context context); static UnboundRole hostedOperator(); static UnboundRole hostedSupporter(); static UnboundRole everyone(); static TenantRole athenzTenantAdmin(TenantName tenant); static TenantRole reader(TenantName tenant); static TenantRole developer(TenantName tenant); static TenantRole administrator(TenantName tenant); static ApplicationRole headless(TenantName tenant, ApplicationName application); static ApplicationRole buildService(TenantName tenant, ApplicationName application); static UnboundRole systemFlagsDeployer(); static UnboundRole systemFlagsDryrunner(); static UnboundRole paymentProcessor(); static UnboundRole hostedAccountant(); RoleDefinition definition(); boolean implies(Role other); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void operator_membership() { Role role = Role.hostedOperator(); assertFalse(mainEnforcer.allows(role, Action.create, URI.create("/not/explicitly/defined"))); assertTrue(mainEnforcer.allows(role, Action.create, URI.create("/controller/v1/foo"))); assertTrue(mainEnforcer.allows(role, Action.update, URI.create("/os/v1/bar"))); assertTrue(mainEnforcer.allows(role, Action.update, URI.create("/application/v4/tenant/t1/application/a1"))); assertTrue(mainEnforcer.allows(role, Action.update, URI.create("/application/v4/tenant/t2/application/a2"))); assertTrue(mainEnforcer.allows(role, Action.read, URI.create("/routing/v1/"))); assertTrue(mainEnforcer.allows(role, Action.read, URI.create("/routing/v1/status/environment/"))); assertTrue(mainEnforcer.allows(role, Action.read, URI.create("/routing/v1/status/environment/prod"))); assertTrue(mainEnforcer.allows(role, Action.create, URI.create("/routing/v1/inactive/environment/prod/region/us-north-1"))); }