public function getEffectiveRolesForUser($user)
    {
        if (isset($user['roles']) && is_array($user['roles'])) {
            $userRoles = $user['roles'];
            $userRoles[] = self::ROLE_EVERYONE;
        } else {
            $userRoles = [];
        }
        $userRoles[] = self::ROLE_ANONYMOUS;

        return $userRoles;
    }
public function getEffectiveRolesForUser($user)
    {
        if (isset($user['roles']) && is_array($user['roles'])) {
            $userRoles = $user['roles'];
            $userRoles[] = self::ROLE_EVERYONE;
        } else {
            $userRoles = [];
        }
        $userRoles[] = self::ROLE_ANONYMOUS;

        return $userRoles;
    }
public function getEffectiveRolesForUser ( $ user ) { if ( isset ( $ user [ 'roles' ] ) && is_array ( $ user [ 'roles' ] ) ) { $ userRoles = $ user [ 'roles' ] ; $ userRoles [ ] = self :: ROLE_EVERYONE ; } else { $ userRoles = [ ] ; } $ userRoles [ ] = self :: ROLE_ANONYMOUS ; return $ userRoles ; }
Gets the effective roles for a given user.
The effective roles include the roles that were explicitly assigned,
as well as the built-in automatic roles.

@param mixed $user an array or array-access object that contains a
'roles' key; if no user is given, "guest" access is
assumed

@return array a list of effective role names for this user
Gets the effective roles for a given user . The effective roles include the roles that were explicitly assigned as well as the built - in automatic roles .