| 12345678910111213141516171819202122232425 |
- namespace Spry.Authorisation {
- public class AuthorisationContext : Object {
- public AuthorisationToken? token { get; private set; }
- public AuthorisationContext(AuthorisationToken? token = null) {
- this.token = token;
- }
- public bool has_permission(string permission = "*") {
- if(token == null){
- return false;
- }
- return token.permissions.any(p => PermissionMatcher.matches(permission, p));
- }
- public bool is_anonymous() {
- return token == null;
- }
- }
- }
|