Skip to content
Discussion options

You must be logged in to vote

Automatic Global Role SuperAdmin

Global roles can be assigned to different teams, and as the primary key of the relationship this is required, If you have a global user, when you register a new team you must assign it the global default role(SuperAdmin) by created event , example on your team model

public static function boot(){
    parent::boot();
    // here assign this team to a global user with global default role
    self::created(function($teamModel){
        // get session team_id to restore it later (maybe optional)
       $session_team_id = getPermissionsTeamId();
       setPermissionsTeamId($teamModel->your_team_id);
       User::find('user_super_admin_id')->assignRole('SuperAdm…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@PaolaRuby
Comment options

@dsturm
Comment options

@erikn69
Comment options

Answer selected by dsturm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants