Exemple #1
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));
        }
Exemple #2
0
        public virtual ActionResult OwnerEdit(Guid ownerId, string ownerIdPropertyName, IntranetActivityTypeEnum activityType, IActivityCreateLinks links)
        {
            var model = new IntranetActivityOwnerEditModel
            {
                Owner = _intranetUserService.Get(ownerId),
                OwnerIdPropertyName = ownerIdPropertyName,
                Links = links
            };

            var currentUser = _intranetUserService.GetCurrentUser();

            model.CanEditOwner = _permissionsService.IsRoleHasPermissions(currentUser.Role, PermissionConstants.CanEditOwner);
            if (model.CanEditOwner)
            {
                model.Users = GetUsersWithAccess(activityType, IntranetActivityActionEnum.Create);
            }

            return(PartialView(OwnerEditViewPath, model));
        }