+ /**
+ * Detach a single permission from this role.
+ * @param RolePermission $permission
+ */
+ public function detachPermission(RolePermission $permission)
+ {
+ $this->permissions()->detach($permission->id);
+ }
+
+ /**
+ * Get the role object for the specified role.
+ * @param $roleName
+ * @return Role
+ */
+ public static function getRole($roleName)
+ {
+ return static::where('name', '=', $roleName)->first();
+ }
+
+ /**
+ * Get the role object for the specified system role.
+ * @param $roleName
+ * @return Role
+ */
+ public static function getSystemRole($roleName)
+ {
+ return static::where('system_name', '=', $roleName)->first();
+ }
+
+ /**
+ * Get all visible roles
+ * @return mixed
+ */
+ public static function visible()
+ {
+ return static::where('hidden', '=', false)->orderBy('name')->get();
+ }
+