public void AddRoleToAccount(Permission role) { roles.Add(role); }
public void AddPermissionToAccount(Permission perm) { permissions.Add(perm); }
public void AddPermissionToRole(Permission perm) { permissions.Add(perm); }
private void LoadRolesOfAccount() { List<IDAndName> roles1 = accountFunctions.GetRolesAccountHas(currentAccount.Id); foreach (IDAndName role in roles1) { Permission p = new Permission(role.id, role.name, true); currentAccount.AddRoleToAccount(p); } List<IDAndName> roles2 = accountFunctions.GetRolesAccountHasNot(currentAccount.Id); foreach (IDAndName role in roles2) { Permission p = new Permission(role.id, role.name, false); currentAccount.AddRoleToAccount(p); } }
private void LoadPermissionsOfAccount() { List<IDAndName> perm1 = accountFunctions.GetGivenPermissionsOfAccount(currentAccount.Id); foreach (IDAndName perm in perm1) { Permission p = new Permission(perm.id, perm.name, true); currentAccount.AddPermissionToAccount(p); } List<IDAndName> perm2 = accountFunctions.GetNotGivenPermissionsOfAccount(currentAccount.Id); foreach (IDAndName perm in perm2) { Permission p = new Permission(perm.id, perm.name, false); currentAccount.AddPermissionToAccount(p); } }
private void LoadPermissionsOfRole() { List<IDAndName> perm1 = roleFunctions.GetGivenPermissionsOfRole(currentRole.id); foreach (IDAndName perm in perm1) { Permission p = new Permission(perm.id, perm.name, true); currentRole.AddPermissionToRole(p); } List<IDAndName> perm2 = roleFunctions.GetNotGivenPermissionsOfRole(currentRole.id); foreach (IDAndName perm in perm2) { Permission p = new Permission(perm.id, perm.name, false); currentRole.AddPermissionToRole(p); } }