Table of Contents

Interface IRoleService

Namespace
Oqtane.Services
Assembly
Oqtane.Client.dll

Service to manage Roles on a Site

public interface IRoleService

Methods

AddRoleAsync(Role)

Add / save a new Role to the database.

Task<Role> AddRoleAsync(Role role)

Parameters

role Role

Returns

Task<Role>

DeleteRoleAsync(int)

Delete / mark-as-deleted a Role in the database.

Task DeleteRoleAsync(int roleId)

Parameters

roleId int

ID-reference of a Role

Returns

Task

GetRoleAsync(int)

Get one specific Role

Task<Role> GetRoleAsync(int roleId)

Parameters

roleId int

ID-reference of a Role

Returns

Task<Role>

GetRolesAsync(int)

Get all Roles of this Site.

Will exclude global roles which are for all sites. To get those as well, use the overload GetRolesAsync(int, bool)

Task<List<Role>> GetRolesAsync(int siteId)

Parameters

siteId int

ID-reference of a Site

Returns

Task<List<Role>>

GetRolesAsync(int, bool)

Get roles of the Site and optionally include global Roles.

Task<List<Role>> GetRolesAsync(int siteId, bool includeGlobalRoles)

Parameters

siteId int

ID-reference to a Site

includeGlobalRoles bool

True if it should also include global roles. False will return the same data as just calling GetRolesAsync(int)

Returns

Task<List<Role>>

UpdateRoleAsync(Role)

Update a Role in the database.

Task<Role> UpdateRoleAsync(Role role)

Parameters

role Role

Returns

Task<Role>