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.

eZ debug

Timing: Jan 18 2025 19:12:01
Script start
Timing: Jan 18 2025 19:12:01
Module start 'content'
Timing: Jan 18 2025 19:12:02
Module end 'content'
Timing: Jan 18 2025 19:12:02
Script end

Main resources:

Total runtime1.2054 sec
Peak memory usage4,096.0000 KB
Database Queries208

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0086 588.0938180.7813
Module start 'content' 0.00861.0457 768.8750621.1641
Module end 'content' 1.05430.1510 1,390.0391341.0234
Script end 1.2054  1,731.0625 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.3407210.0002
Check MTime0.00160.1361210.0001
Mysql Total
Database connection0.00200.163210.0020
Mysqli_queries1.098491.11742080.0053
Looping result0.00230.19192060.0000
Template Total1.169597.020.5847
Template load0.00300.248020.0015
Template processing1.166596.768020.5832
Template load and register function0.00020.019210.0002
states
state_id_array0.00150.122810.0015
state_identifier_array0.00120.101420.0006
Override
Cache load0.00210.1734850.0000
Sytem overhead
Fetch class attribute can translate value0.00160.134940.0004
Fetch class attribute name0.00110.094490.0001
XML
Image XML parsing0.00160.131940.0004
class_abstraction
Instantiating content class attribute0.00000.0022110.0000
General
dbfile0.00190.1580330.0001
String conversion0.00000.000430.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
19content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
13content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 46
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs