File systeme V3

This commit is contained in:
Mathieu Lagacé
2020-10-19 18:45:05 -04:00
parent 1664bb06aa
commit 4f83774200
27 changed files with 2030 additions and 1223 deletions

View File

@@ -387,4 +387,30 @@ class User extends Authenticatable
return Carbon::parse($val->created_at)->format('Y-m-d');
});
}
public function checkACLRules($rule)
{
if ($rule->user_id == $this->id || $rule->user_id == '*')
{
return $rule->access;
}
if ($rule->job_id == $this->job_id || $rule->job_id == '*')
{
return $rule->access;
}
if ($rule->rank_id == $this->rank_id || $rule->rank_id == '*')
{
return $rule->access;
}
return -1;
}
public function checkACLRulesVisitor($rule)
{
if ($rule->user_id == '*')
{
return $rule->access;
}
return -1;
}
}