public function getDefaultBlogRole(User $user) { $role = "ROLE_BLOG_CONTRIBUTOR"; if ($user->hasRole('ROLE_BLOG_ADMIN')) { return 'ROLE_BLOG_ADMIN'; } elseif ($user->hasRole('ROLE_BLOG_EDITOR')) { return 'ROLE_BLOG_EDITOR'; } elseif ($user->hasRole('ROLE_BLOG_AUTHOR')) { return 'ROLE_BLOG_AUTHOR'; } return $role; }
/** * {@inheritDoc} */ public function hasRole($role) { $this->__initializer__ && $this->__initializer__->__invoke($this, 'hasRole', array($role)); return parent::hasRole($role); }