Ejemplo n.º 1
0
        protected async Task AddPersonalAdminPermissionForUsers()
        {
            var employeePermission = new EmployeePermission
            {
                ResponsibleForUserId = _currentUserId,
                ResponsibleUserId    = _currentUserId,
                PermissionType       = 2,
                IsExplicit           = true
            };

            _personalLegacyDb.EmployeePermissions.Add(employeePermission);
            _personalLegacyDb.SaveChanges();
        }
Ejemplo n.º 2
0
        public void AddPermission(int employeeId, PermissionEnum permission)
        {
            List <EmployeePermission> previous = _context.EmployeePermissions.Where(x => x.EmployeeId == employeeId).ToList();
            EmployeePermission        ep       = new EmployeePermission
            {
                EmployeeId = employeeId,
                Permission = permission
            };

            _context.Add(ep);
            _context.SaveChanges();

            List <EmployeePermission> current = _context.EmployeePermissions.Where(x => x.EmployeeId == employeeId).ToList();

            addPermissionChange(employeeId, previous, current);
        }
Ejemplo n.º 3
0
 public EmployeePermissionViewModel(EmployeePermission ep)
 {
     EmployeeId           = ep.EmployeeId;
     Permission           = ep.Permission;
     EmployeePermissionId = ep.EmployeePermissionId;
 }