using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SKMC.Api.Client.Access
{
///
/// 角色权限访问接口
///
public interface IClientRoleAccesser
{
///
/// 当前角色
///
ClientRole UserRole { get; set; }
///
/// 权限标识, 切换权限时变更
///
int AccessToken { get; set; }
///
/// 所有角色列表(下拉选择)
///
ObservableCollection ClientRoles { get; set; }
///
/// 角色登录
///
/// 角色码
/// 登录密码
/// 后置动作
///
bool Login(string roleCode, string password, Action action = null);
///
/// 当前角色登出
///
/// 后置动作
void Logout(Action action = null);
///
/// 密码验证
///
/// 角色码
/// 登录密码
/// 后置动作
///
bool CheckPassword(string roleCode, string password, Action action = null);
///
/// 更改密码
///
/// 角色码
/// 登录密码
/// 新密码
void ChangePassword(string roleCode, string password, string newpwd);
///
/// 权限验证
///
///
///
bool HasAccess(string accessCode);
///
/// 权限验证, 并根据设备状态匹配
///
///
///
bool HasAccess(string accessCode, byte deviceStatus);
///
/// 加载角色(权限)
///
/// 角色码, null表示初始角色
///
ClientRole LoadRole(string roleCode = null, Action action = null);
///
/// 加载角色的事件
///
event Action LoadRoleEvent;
///
/// 卸载角色(权限)
///
void UnloadRole(Action action = null);
}
}