Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 18 additions & 13 deletions app/controllers/deadbolt/Deadbolt.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,26 @@ private static RoleHolder getRoleHolder()
@Before
static void checkRestrictions() throws Throwable
{
DEADBOLT_HANDLER.beforeRoleCheck();

RoleHolder roleHolder = getRoleHolder();
RestrictionType restrictionType = getRestrictionType();
if (restrictionType == RestrictionType.DYNAMIC)
{
handleDynamicChecks(roleHolder);
}
else if (restrictionType == RestrictionType.STATIC)
{
handleStaticChecks(roleHolder);
}
else if (restrictionType == RestrictionType.BASIC)

if (restrictionType != null && restrictionType != RestrictionType.NONE)
{
handleRoleHolderPresent(roleHolder);
DEADBOLT_HANDLER.beforeRoleCheck();

RoleHolder roleHolder = getRoleHolder();

if (restrictionType == RestrictionType.DYNAMIC)
{
handleDynamicChecks(roleHolder);
}
else if (restrictionType == RestrictionType.STATIC)
{
handleStaticChecks(roleHolder);
}
else if (restrictionType == RestrictionType.BASIC)
{
handleRoleHolderPresent(roleHolder);
}
}
}

Expand Down