public RestrictedActionAttribute(
     PermissionResourceTypeEnum resourceType,
     PermissionActionEnum action,
     bool childAction = false)
 {
     _permissionSettingIdentity = PermissionSettingIdentity.Of(action, resourceType);
     _childAction = childAction;
 }
Beispiel #2
0
        private static PermissionUpdateModel CreatePermission(
            IntranetMemberGroup group,
            PermissionResourceTypeEnum resource,
            PermissionActionEnum action,
            bool allowed = true, bool enabled = true)
        {
            var identity = new PermissionSettingIdentity(action, resource);
            var settings = new PermissionSettingValues(allowed, enabled);

            return(new PermissionUpdateModel(group, settings, identity));
        }
Beispiel #3
0
 public ContentRestrictedActionApiAttribute(PermissionResourceTypeEnum resourceType, PermissionActionEnum action)
 {
     _permissionSettingIdentity = PermissionSettingIdentity.Of(action, resourceType);
 }
Beispiel #4
0
        public virtual ActionResult OwnerEdit(Guid ownerId, string ownerIdPropertyName, PermissionResourceTypeEnum activityType, IActivityCreateLinks links)
        {
            var model = new IntranetActivityOwnerEditModel
            {
                Owner = _intranetMemberService.Get(ownerId).Map <MemberViewModel>(),
                OwnerIdPropertyName = ownerIdPropertyName,
                Links = links
            };

            model.CanEditOwner = _permissionsService.Check(activityType, PermissionActionEnum.EditOwner);

            if (model.CanEditOwner)
            {
                model.Members = GetUsersWithAccess(PermissionSettingIdentity.Of(PermissionActionEnum.Create, activityType));
            }

            return(PartialView(OwnerEditViewPath, model));
        }