Class RoleBasedAuthorization
- java.lang.Object
-
- io.vertx.reactivex.ext.auth.authorization.RoleBasedAuthorization
-
- All Implemented Interfaces:
io.vertx.lang.rx.RxDelegate,Authorization
public class RoleBasedAuthorization extends Object implements io.vertx.lang.rx.RxDelegate, Authorization
Represents a role. Note that this role can optionally be assigned to a specific resourceNOTE: This class has been automatically generated from the
originalnon RX-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static io.vertx.lang.rx.TypeArg<RoleBasedAuthorization>__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description RoleBasedAuthorization(RoleBasedAuthorization delegate)RoleBasedAuthorization(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RoleBasedAuthorizationcreate(String role)booleanequals(Object o)RoleBasedAuthorizationgetDelegate()StringgetResource()returns an optional resource that the role is assigned-onStringgetRole()returns the roleinthashCode()booleanmatch(AuthorizationContext context)this methods verifies whether or not the authorization match the specified context.booleanmatch(User user)this methods verifies whether or not the authorization match the specified user.static RoleBasedAuthorizationnewInstance(RoleBasedAuthorization arg)RoleBasedAuthorizationsetResource(String resource)sets an optional resource that the role is assigned-onJsonObjecttoJson()StringtoString()booleanverify(Authorization authorization)this method verifies whether or not the authorization implies the specified authorization.
-
-
-
Field Detail
-
__TYPE_ARG
public static final io.vertx.lang.rx.TypeArg<RoleBasedAuthorization> __TYPE_ARG
-
-
Constructor Detail
-
RoleBasedAuthorization
public RoleBasedAuthorization(RoleBasedAuthorization delegate)
-
RoleBasedAuthorization
public RoleBasedAuthorization(Object delegate)
-
-
Method Detail
-
getDelegate
public RoleBasedAuthorization getDelegate()
- Specified by:
getDelegatein interfaceAuthorization- Specified by:
getDelegatein interfaceio.vertx.lang.rx.RxDelegate
-
match
public boolean match(AuthorizationContext context)
this methods verifies whether or not the authorization match the specified context.- Specified by:
matchin interfaceAuthorization- Parameters:
context- the context.- Returns:
- true if there's a match.
-
verify
public boolean verify(Authorization authorization)
this method verifies whether or not the authorization implies the specified authorization. Note that it doesn't always mean an exact match. For instance, in the case of aWildcardPermissionBasedAuthorization, this method may return true even if the permissions are different WildcardPermissionBasedAuthorization.create('*').verify(WildcardPermissionBasedAuthorization.create('anypermission')) would return true- Specified by:
verifyin interfaceAuthorization- Parameters:
authorization- the authorization.- Returns:
- true if implies the argument.
-
toJson
public JsonObject toJson()
- Specified by:
toJsonin interfaceAuthorization
-
create
public static RoleBasedAuthorization create(String role)
-
getRole
public String getRole()
returns the role- Returns:
-
getResource
public String getResource()
returns an optional resource that the role is assigned-on- Returns:
-
setResource
public RoleBasedAuthorization setResource(String resource)
sets an optional resource that the role is assigned-on- Parameters:
resource-- Returns:
-
match
public boolean match(User user)
this methods verifies whether or not the authorization match the specified user. Internally a basic context is created with the user and the method delegates toAuthorization.match(io.vertx.reactivex.ext.auth.authorization.AuthorizationContext)- Parameters:
user- the user.- Returns:
- true if there's a match
-
newInstance
public static RoleBasedAuthorization newInstance(RoleBasedAuthorization arg)
-
-