Help with Author settings

5 posts by 2 authors in: Forums > CMS Builder
Last Post: November 9, 2011   (RSS)

By nmsinc - November 8, 2011

[font "Tahoma"]Setting users to “Author” should only allow the user to view and edit files they have created. Our design requires Authors to first create files in three distinct sections. These files are then used in three other distinct sections as a text field list where the user makes a choice from his/her records.[/#000000]

[/#000000]

Here is my dilemma:[/#000000]

[/#000000]

As the Author is creating a new record using the records from the other three sections, he/she can view and choose from all records created by all users and not just the ones he/she has created. [/#000000]

[/#000000]

What changes do I need to make to correct this so that the Author only sees his/her records as a choice?[/#000000]
nmsinc

Re: [nmsinc] Help with Author settings

By Jason - November 8, 2011

Hi,

What you can do is use a custom SQL string to populate your list box.

Try this,
When creating your list, for List Options select "Get options from MySQL Query (advanced)".

Here is an example of a query that will use "num" as the option value and "title'' as the option label from a section called "news". It will restrict options to only those created by the user currently logged in:

SELECT num, title
FROM `<?php echo $TABLE_PREFIX ?>news`
WHERE createdByUserNum = '<?php echo $CURRENT_USER['num'];?>'


Hope this helps get you started.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [nmsinc] Help with Author settings

By nmsinc - November 8, 2011

Thanks Jason; however, I also have users with "Author and View" and "Editor" rights, will this code set prevent them from seeing all records?
nmsinc

Re: [Jason] Help with Author settings

By nmsinc - November 9, 2011

Thanks Jason,

This worked perfect!
nmsinc