public static interface Authorization.ExtensibleAuthorization extends Authorization.AuthorizationExtension
|Modifier and Type||Method and Description|
This directive is supposed to extract all required data for any user authorization.
The function can be used many times for the same user.
One could make the Authorization implementations split in two parts: // This directive gets the user identification data from the request. private def extractUserData: Directive1[UserData]
// Tests if user specified by UserData has permission for request OmiRequest. // Function is in curried format. // @return Boolean, true if connection is permitted to do input. private def hasPermission: UserData => OmiRequest => Boolean
def makePermissionTestFunction = combineWithPrevious(super.makePermissionTestFunction, extractUserData map hasPermission)
NOTE: Put this as up in routing DSL as possible because some extractors seem to not working properly otherwise.