Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GasStationController" /> class.
 /// </summary>
 /// <param name="unitOfWork">The unit of work.</param>
 public GasStationController(IUnitOfWorkAsync unitOfWork) : base(unitOfWork)
 {
     ActionPolicies.Add(ModelAction.Create, UserRoleEnum.Admin);
     ActionPolicies.Add(ModelAction.Update, UserRoleEnum.Admin);
     ActionPolicies.Add(ModelAction.Delete, UserRoleEnum.Admin);
     ActionPolicies.Add(ModelAction.Export, UserRoleEnum.Admin);
     ActionPolicies.Add(ModelAction.Publish, UserRoleEnum.Admin);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NotebookController" /> class.
        /// </summary>
        /// <param name="unitOfWork">The unit of work.</param>
        /// <param name="userInfo">The user information.</param>
        public NotebookController(IUnitOfWorkAsync unitOfWork, IUserInfo userInfo)
            : base(unitOfWork, userInfo)
        {
            var AccessLevels = new[] { UserAccessLevel.User, UserAccessLevel.Admin };

            ActionPolicies.Add(ModelAction.Read, AccessLevels);
            ActionPolicies.Add(ModelAction.Create, AccessLevels);
            ActionPolicies.Add(ModelAction.Update, AccessLevels);
            ActionPolicies.Add(ModelAction.Delete, AccessLevels);
        }