mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-21 10:49:10 -04:00
File systeme V3
This commit is contained in:
26
app/User.php
26
app/User.php
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user