mirror of
https://github.com/lempamo/Project-Unite.git
synced 2025-01-22 11:21:47 -05:00
thermal paste-yfry
This commit is contained in:
parent
8c265ebf36
commit
968ea14cae
1 changed files with 12 additions and 9 deletions
|
@ -284,8 +284,10 @@ public static void UpdateACLDefinitions(string fid)
|
|||
|
||||
if (forum.Permissions.Length < db.Roles.Count())
|
||||
{
|
||||
var rolesToAdd = db.Roles.Where(r => forum.Permissions.FirstOrDefault(p => p.RoleId == r.Id) == null);
|
||||
foreach(var role in rolesToAdd)
|
||||
var roles = db.Roles.ToArray();
|
||||
foreach(var role in roles)
|
||||
{
|
||||
if (db.ForumPermissions.FirstOrDefault(x => x.CategoryId == fid && x.RoleId == role.Id) == null)
|
||||
{
|
||||
var perm = new ForumPermission();
|
||||
perm.Id = Guid.NewGuid().ToString();
|
||||
|
@ -295,6 +297,7 @@ public static void UpdateACLDefinitions(string fid)
|
|||
db.ForumPermissions.Add(perm);
|
||||
recordsAdded++;
|
||||
}
|
||||
}
|
||||
db.AuditLogs.Add(new AuditLog("system", AuditLogLevel.Admin, $"Automatic forum ACL update occurred - Forum: {forum.Name}, records added: {recordsAdded}."));
|
||||
db.SaveChanges();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue