Skip to main content
The World's Best Known Brand for Microsoft Project and Project Server Expertise

Project Server Experts Community Site

Search
Project Server Experts Community Site
Project Server Help Blog
MSProject Experts
Training Schedule
Contact Us
  
Project Server Experts Community Site > Project Server FAQ KnowledgeBase > ChangeSecurityCategories  


How do I change the security Category for a project automatically using an enterprise custom Project field?



Microsoft Project Server Frequently Asked Questions (FAQs): Overview



Microsoft Project Server Frequently Asked Questions (FAQs): Details

Resolution

MS Project Server does not allow project managers to put their projects into a security category. We overcome this shortcoming by creating a custom enterprise Project flag field and adding a SQL trigger to the msp_flag_fields table.

We will call the flag field “Department A Only”. If this value is true, then the project belongs in the “Department A” category. If it is false, the project does not belong in this category.

After you create the custom field and security category, look up the conv_value in the msp_conversions table.  Then look up the value of wsec_cat_id in the msp_web_security_categories table.  The values for my example are 188744649 and 101 respectively.

Finally, create the following trigger on the msp_flag_fields table and test.

CREATE TRIGGER [Category] ON [dbo].[MSP_FLAG_FIELDS]
FOR INSERT, UPDATE
AS

declare @Const_flag_field as integer
select @Const_flag_field=188744649 -- Value of controlling flag from msp_conversions

declare @Const_wsec_cat_id as integer
select @Const_wsec_cat_id=101  --ID of category from msp_web_security_categories

declare @flag_field_id as integer
declare @flag_value as integer
declare @wproj_id as integer

Select @flag_field_id=i.flag_field_id, @flag_value=flag_value, @wproj_id=p.wproj_id
from inserted i
        inner join msp_web_projects p on i.proj_id=p.proj_id

if @flag_field_id=@Const_Flag_Field
Begin
        if @flag_value=1
        Begin
                Insert into msp_web_security_category_objects
                values (@Const_wsec_cat_id, 1, @wproj_id)
        End
        Else
        Begin
                delete from msp_web_security_category_objects
                where wsec_cat_id=@Const_wsec_cat_id
                        and wsec_obj_type=1
                        and wsec_obj_id=@wproj_id
        end

end

 

 

Stay Connected

Join Our
LinkedIn Network
Follow Us
on Twitter

About FAQs

Microsoft Project Server Frequently Asked Questions (FAQs) provide information about Microsoft Project Server 2002, Microsoft Project Server 2003, Microsoft Project Server 2007, and Microsoft Project Server 2010.

Topics include common errors and the Project Server queue, project manager and resource manager approvals, enterprise calendars, enterprise custom fields, enterprise projects and the enterprise resource pool, user access, reports and OLAP analysis, resource work, project costing, task progress reporting and timesheets, Project Web Access (PWA) and Project Professional, check-out check-in and the local cache, saving and publishing, and issues risks deliverables documents and project workspaces.

About This Site

Project Server Experts (www.projectserverexperts.com) is an online community that provides answers to Project Server Frequently Asked Questions, allows members of the Project Server community to connect with one another by uploading their Business Cards, provides links to online Project Server resources, and links to Microsoft Project and Project Server related jobs.

This site is brought to you by MSProjectExperts. If you find the information posted here useful, please consider visiting our commercial site (www.msprojectexperts.com) for Project Server books, Project Server training and Project Server consulting services. Please support our sponsors. Thanks. -- The MSProjectExperts Team

Submissions

We welcome content submissions. We give author credit and cross link on all accepted articles. Please send your articles and suggestions to info(at)msprojectexperts.com.

Copyright

Reproduction of content on this site is strictly prohibited without the express permission of MSProjectExperts. Copyright (c) 2011 CHEFETZ LLC. All rights reserved