Esempio n. 1
0
        private void AddPermission(int roleId, string groupPermission, int[] listPermission, bool isAddOrUpdate = false)
        {
            var permission = new Permission
            {
                RoleId          = roleId,
                GroupPermission = groupPermission,
                Value           = listPermission?.Sum() ?? 0
            };

            if (isAddOrUpdate)
            {
                PermissionService.CreateOrUpdate(permission);
            }
            else
            {
                PermissionService.Insert(permission);
            }
        }