Forums / Setup & design / To set the permission for changing the content only to the administrator.

To set the permission for changing the content only to the administrator.

Author Message

nga patel

Thursday 14 April 2005 12:57:00 am

I have set the Button on the front page, from which all the user can change the content of site without going into the admin, but I want to give this right only to the administrator user not all the user.

SO, can anybody tell from where and how I can set this permission.
Thanking You

-----------------------------------------------------
"Anyone who has never made a mistake has never tried anything new." -- Einstein

Frey Staso

Thursday 14 April 2005 3:14:02 pm

Ok bear with me, this might be a little confusing:

You can limit the permissions on something by doing a loop that is only true when the person logged in has a specific role assigned to them. I am using this script for buttons that don't even show up unless the user has the correct role

it goes like this

{let user=fetch( 'user', 'current_user' )}
{section loop=$user.role_id_list}
	{section show=eq($:item, 72)}

        I am a button

{/section}
{/section}
{/let}

now users with the role "72" assigned to them will see "I am a button" while everyone else will skip that code completely. You can put a form in there or a picture, or text, ezpublish code whatever you want.

Alternately if you wanted, you could PUT the button info in there, then do an if-then-else to make an else statement for everyone who doesn't have that permission, so you could have one text for this role and another for those who don't have it. You could even nest them (I think).

Eivind Marienborg

Thursday 14 April 2005 10:11:36 pm

I would recommend using the built in eZ Publish role system. You put the users into different user groups, and define which groups should be allowed to edit things by applying different roles to the different user groups.

Placing users in groups:
http://www.ez.no/ez_publish/documentation/building_an_ez_publish_site/the_guestbook/making_the_button_work

Adding an edit button only to those who are allowed to edit:
http://www.ez.no/ez_publish/documentation/customization/tips_tricks/editing_creating_and_removing_content_from_the_user_page

nga patel

Friday 15 April 2005 12:56:28 am

thanks for your suggestion, but I already go through these links, but the real problem is little bit different which is as follows:
In my site I had set the button on the front page from where anyone can change the content of the site, so I want to set the situation under which the normal user just send the suggestion/comments and could not published it but it is done by administrator only.
In the book(namely "Learning eZ publish 3") under the headline of topic "AUTHORIZATION AND ROLES" I had read that 'You can specify that a normal user can add comments to articles, but not submit articles themselves.', but there no further things is given and I try to set this logic, but could not.
If you have any idea then it is very much welcome for me.

Eivind Marienborg

Friday 15 April 2005 1:50:53 am

If you want the users to be able to add comments, but not articles, you simply have to set up this in your roles.

If you want the common users to be able to edit the content, but not publish it without the approval of an administrator, you have to look into approvals. Follow the tutorial from here on out: http://www.ez.no/ez_publish/documentation/building_an_ez_publish_site/the_guestbook/implementing_an_approval_mechanism

Sorry if this is confusing, I might be missing your point here..

nga patel

Friday 15 April 2005 3:05:28 am

I think, I could do something with your previously given advise but there is still some problem.
My suggestion and edit script is as follow:
where 12 is the object id of the guest accounts and any new register will fall inside this group and so I had done this arrangement,

{section show=count($node.object.id|eq(12)}
<form method="post"
action={"content/action/"|ezurl}>

<input class="button"
type="submit"
name="NewButton"
value="Comment of the User" />

<input type="hidden"
name="ClassID"
value="13" />

<input type="hidden"
name="NodeID"
value="{$node.node_id}" />
</form>
{/section}

{section-else}

{section show=count($node.object.can_create_class_list)}

<form method="post" action={"/content/action"|ezurl}>
<input type="hidden" name="NodeID" value="{$node.node_id}" />
<select name="ClassID">
{section var=class loop=$node.object.can_create_class_list}
<option value="{$class.id}">{$class.name|wash}</option>
{/section}
</select>




<input type="submit" name="NewButton" value="{'Create Here'|i18n('design/standard/node/view')}" />
</form>
{/section}



{section show=$node.object.can_edit}
<a href={concat("/content/edit/", $node.object.id)|ezurl}>Edit Here</a>
{/section}
{/section}

but now the problem is that when new user register then on the front page after registering as new user I received the messeages that "You are successfully register and you will received an e mail as follow the instrustion" but the problem is that I could not received any mail.
To solve this problem I had added one line in setting/site.ini.append.php that
[UserSettings]
RegistrationEmail=
VerifyUserEmail=disabled
and then also clar the cache then also there is still same problem so I have to do anything else?
you could suggest me something.

Eivind Marienborg

Friday 15 April 2005 3:37:31 am

Sorry, I'm blank at this. It might be an idea to create a new topic with your new problem, by the way.