Exemple #1
0
        public void CreateUserRole(UserRole userRole)
        {
            if (userRole == null)
            {
                throw new ArgumentNullException("The user role object must not be null");
            }

            userRoleRepository.Add(userRole);
            securityUnitOfWork.Commit();
        }
        public void CreateWebsitePermission(WebSiteAccessPermission webSiteAccessPermission)
        {
            if (webSiteAccessPermission == null)
            {
                throw new ArgumentNullException("The web site access permission object must not be null");
            }

            webSiteAccessPermissionRepository.Add(webSiteAccessPermission);
            securityUnitOfWork.Commit();
        }
        public void CreateRole(Role role)
        {
            if (role == null)
            {
                throw new ArgumentNullException("The role object must not be null");
            }

            if (string.IsNullOrEmpty(role.Name))
            {
                throw new ArgumentNullException("The role name must not be null or empty");
            }

            role.Id = Guid.NewGuid();
            roleRepository.Add(role);
            securityUnitOfWork.Commit();
        }
Exemple #4
0
        public void CreateUser(User user)
        {
            if (user == null)
            {
                throw new ArgumentNullException("user cannot be null");
            }

            if (string.IsNullOrEmpty(user.ADName))
            {
                throw new ArgumentNullException("user must have a valid ADName");
            }

            user.Id = Guid.NewGuid();

            userRepository.Add(user);
            securityUnitOfWork.Commit();
        }