public void SelectCommunityToAdd()
        {
            long idCall = View.IdCall;

            if (UserContext.isAnonymous)
            {
                View.DisplaySessionTimeout();
            }
            else
            {
                Dictionary <Int32, long> rPermissions = new Dictionary <Int32, long>();
                Boolean forAdmin = (UserContext.UserTypeID == (Int32)UserTypeStandard.SysAdmin) || (UserContext.UserTypeID == (Int32)UserTypeStandard.Administrator) || (UserContext.UserTypeID == (Int32)UserTypeStandard.Administrative);
                Core.BaseModules.CommunityManagement.CommunityAvailability availability = (forAdmin) ? Core.BaseModules.CommunityManagement.CommunityAvailability.All : Core.BaseModules.CommunityManagement.CommunityAvailability.Subscribed;
                long permissions = -1;
                switch (View.CallType)
                {
                case CallForPaperType.CallForBids:
                    permissions = (long)ModuleCallForPaper.Base2Permission.Admin | (long)ModuleCallForPaper.Base2Permission.ManageCalls | (long)ModuleCallForPaper.Base2Permission.AddCall;
                    break;

                case CallForPaperType.RequestForMembership:
                    permissions = (long)ModuleRequestForMembership.Base2Permission.Admin | (long)ModuleRequestForMembership.Base2Permission.ManageRequests | (long)ModuleRequestForMembership.Base2Permission.AddRequest;
                    break;
                }
                rPermissions.Add(View.IdCallModule, permissions);
                rPermissions.Add(CommunityService.ServiceModuleID(), (long)lm.Comol.Core.DomainModel.Domain.ModuleCommunityManagement.Base2Permission.Manage | (long)lm.Comol.Core.DomainModel.Domain.ModuleCommunityManagement.Base2Permission.AdminService);
                List <Int32> idCommunities = CallService.GetIdCommunityAssignments(idCall);
                View.DisplayCommunityToAdd(UserContext.CurrentUserID, forAdmin, rPermissions, idCommunities, availability);
            }
        }
Example #2
0
        public void InitializeCommunitySelector()
        {
            long idVersion = View.IdVersion;

            TemplateDefinitionVersion version      = Service.GetVersion(idVersion);
            Dictionary <Int32, long>  rPermissions = new Dictionary <Int32, long>();
            Boolean forAdmin = (UserContext.UserTypeID == (Int32)UserTypeStandard.SysAdmin) || (UserContext.UserTypeID == (Int32)UserTypeStandard.Administrator) || (UserContext.UserTypeID == (Int32)UserTypeStandard.Administrative);

            Core.BaseModules.CommunityManagement.CommunityAvailability availability = (forAdmin) ? Core.BaseModules.CommunityManagement.CommunityAvailability.All : Core.BaseModules.CommunityManagement.CommunityAvailability.Subscribed;

            /*if (version!=null && version.Template!= null && version.Template.OwnerInfo.Type== OwnerType.Module)
             *  rPermissions.Add(version.Template.OwnerInfo.IdModule, version.Template.OwnerInfo.);
             * else*/
            rPermissions.Add(Service.ServiceModuleID(), (long)ModuleTemplateMessages.Base2Permission.Administration | (long)ModuleTemplateMessages.Base2Permission.ManageTemplates);
            rPermissions.Add(CommunityService.ServiceModuleID(), (long)lm.Comol.Core.DomainModel.Domain.ModuleCommunityManagement.Base2Permission.Manage | (long)lm.Comol.Core.DomainModel.Domain.ModuleCommunityManagement.Base2Permission.AdminService);
            List <Int32> idCommunities = Service.GetIdCommunityAssignments(idVersion);

            View.InitializeCommunityToAdd(UserContext.CurrentUserID, forAdmin, rPermissions, idCommunities, availability);
        }