Skip to content

Commit 3657de7

Browse files
committed
Simplifying the hasPermission interface by always handling the array of permissions in the abstraction, not the interface.
1 parent 3c4bd4c commit 3657de7

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ test-harness/logs/**
1111
test-harness/modules/**
1212

1313
# log files
14-
logs/**
14+
logs/**
15+
16+
modules/**

models/jwt/JwtService.cfc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -759,10 +759,7 @@ component accessors="true" singleton {
759759
results.allow = (
760760
tokenHasScopes( arguments.permissions, payload.scope )
761761
||
762-
variables.cbSecurity
763-
.getAuthService()
764-
.getUser()
765-
.hasPermission( arguments.permissions )
762+
variables.cbSecurity.has( arguments.permissions )
766763
);
767764
results.type = "authorization";
768765
} else {

models/validators/CBAuthValidator.cfc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ component singleton {
5757
if ( variables.cbSecurity.getAuthService().isLoggedIn() ) {
5858
// Do we have any permissions?
5959
if ( listLen( arguments.permissions ) ) {
60-
results.allow = variables.cbSecurity.getAuthService().getUser().hasPermission( arguments.permissions );
60+
results.allow = variables.cbSecurity.has( arguments.permissions );
6161
results.type = "authorization";
6262
} else {
6363
// We are satisfied!

0 commit comments

Comments
 (0)