namespace LeanCloud.Storage { /// /// 角色 /// public class LCRole : LCObject { public const string CLASS_NAME = "_Role"; /// /// 名字 /// public string Name { get { return this["name"] as string; } set { this["name"] = value; } } /// /// 关联角色 /// public LCRelation Roles { get { LCRelation roles = this["roles"] as LCRelation; return new LCRelation { Parent = roles.Parent, Key = "roles" }; } } /// /// 关联用户 /// public LCRelation Users { get { LCRelation users = this["users"] as LCRelation; return new LCRelation { Parent = users.Parent, Key = "users" }; } } public LCRole() : base(CLASS_NAME) { } public static LCRole Create(string name, LCACL acl) { LCRole role = new LCRole() { Name = name, ACL = acl }; return role; } /// /// 获取角色查询对象 /// /// public static LCQuery GetQuery() { return new LCQuery(CLASS_NAME); } } }