Remove a group from a role.

@param int $group_id
@param int $role_id
333193
public function removeGroupFromRole(int $group_id, int $role_id)
    {

        $role = $this->getRole($role_id);
        if ($role->groups()->detach($group_id) > 0)
            event(new UserGroupRoleRemoved($group_id, $role));

    }
583970
public function giveGroupsRole(array $group_ids, int $role_id)
    {

        foreach ($group_ids as $group_id) {

            $group = Group::where('id', $group_id)->first();
            $this->giveGroupRole($group->id, $role_id);
        }
    }
360889
public function removeRole($role)
    {
        if ($role instanceof Role) {
            $role = $role->id;
        }

        if (false !== ($index = array_search($role, $this->attributes['roles']))) {
            unset($this->attributes['roles'][$index]);
        }

        return true;
    }
657494
public function removePermissions($role_id, $permission_id)
    {

        $this->removePermissionFromRole($permission_id, $role_id);

        return redirect()->back()
            ->with('success', trans('web::seat.permission_revoked'));
    }
95353
public static function delete_cohort_role_assignment($id) {
        $cohortroleassignment = new cohort_role_assignment($id);
        $context = context_system::instance();

        // First we do a permissions check.
        require_capability('moodle/role:manage', $context);

        // OK - all set.
        return $cohortroleassignment->delete();
    }
1010679
@Override
	public void removeByGroupId(long groupId) {
		for (CPSpecificationOption cpSpecificationOption : findByGroupId(
				groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(cpSpecificationOption);
		}
	}
874279
def delete_role(role_id)
      @roles.reject! { |r| r.id == role_id }
      @members.each do |_, member|
        new_roles = member.roles.reject { |r| r.id == role_id }
        member.update_roles(new_roles)
      end
      @channels.each do |channel|
        overwrites = channel.permission_overwrites.reject { |id, _| id == role_id }
        channel.update_overwrites(overwrites)
      end
    end
163113
@Override
	public void removeByGroupId(long groupId) {
		for (CommerceDiscountUsageEntry commerceDiscountUsageEntry : findByGroupId(
				groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(commerceDiscountUsageEntry);
		}
	}
615071
@Override
	public void removeByGroupId(long groupId) {
		for (CommerceSubscriptionEntry commerceSubscriptionEntry : findByGroupId(
				groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(commerceSubscriptionEntry);
		}
	}
1316701
public function delete_firewallgroup($group_id)
    {
        if (!$this->is_loggedin) {
            return false;
        }

        $this->request_type = 'DELETE';
        $response           = $this->exec_curl('/api/s/' . $this->site . '/rest/firewallgroup/' . trim($group_id));

        return $this->process_response_boolean($response);
    }
746078
public function authRoleUserDelete($user_id){
        self::where(['user_id'=>$user_id])->delete();
        AuthAccess::where(['role_id'=>$user_id,'type'=>'admin'])->delete();
    }
549209
def _remove_rule(self, group, role, value=None):
        """"""
        if role not in group:
            return

        if value is None:
            group.pop(role, None)
        else:
            group[role].remove(value)

        self.invalidate()
1088166
@Override
	public void removeByGroupId(long groupId) {
		for (CommerceCurrency commerceCurrency : findByGroupId(groupId,
				QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(commerceCurrency);
		}
	}
873492
public void removeGroup(int groupId) {
        PreparedStatement statement = null;

        try (Connection sqlConnection = sqlService.getConnection()) {
            statement = sqlConnection.prepareStatement(
                "DELETE FROM " + Constants.DB_TABLE_GROUPS
                    + " WHERE " + Constants.GENERIC_ID + " = ?"
            );
            statement.setInt(1, groupId);
            statement.executeUpdate();
            statement.close();

            statement = sqlConnection.prepareStatement(
                "DELETE FROM " + Constants.DB_TABLE_OVERRIDE +
                    " WHERE " + Constants.OVERRIDE_GROUP_ID + " = ?"
            );

            statement.setInt(1, groupId);
            statement.executeUpdate();
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            try {
                if (statement != null) {
                    statement.close();
                }
            } catch (Exception e) {
            }
        }
        removeGroupIdFromTablePaths(groupId);
    }
268839
@Override
	public void removeByGroupId(long groupId) {
		for (CPInstance cpInstance : findByGroupId(groupId, QueryUtil.ALL_POS,
				QueryUtil.ALL_POS, null)) {
			remove(cpInstance);
		}
	}
432725
public function removeRole(Role $role)
    {
        $this->initializeRoles();
        if ($this->hasRole($role)) {
            $roleIdentifier = $role->getIdentifier();
            unset($this->roles[$roleIdentifier]);
            $identifierIndex = array_search($roleIdentifier, $this->roleIdentifiers);
            unset($this->roleIdentifiers[$identifierIndex]);
        }
    }
589965
@Override
	public void removeByGroupId(long groupId) {
		for (CPDefinitionOptionValueRel cpDefinitionOptionValueRel : findByGroupId(
				groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(cpDefinitionOptionValueRel);
		}
	}