Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- rgasch created topic »Using PageUtil::addVar() to load script code« 11:48 AM
- michiel responded to »password problem« 10:01 AM
- mazdev responded to »Hide "Register new account" and change template to 3 col« 07:50 AM
- mesteele101 created topic »Zikula 1.3.3 - Site Search 1.5.2 - Unable to turn off plug-ins« 07:48 AM
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 25. May
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 25. May
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 25. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
pnSecAuthAction replacement?
-
- Rank: Helper
- Registered: Dec 31, 1969
- Last visit: May 20, 2010
- Posts: 524
Hi all, apparently, pnSecAuthAction() has been taken away, is there a new way to check for permissions in the code? -
- Rank: Developer
- Registered: Aug 23, 2003
- Last visit: May 31, 2010
- Posts: 1428
Hi,
you can use SecurityUtil::checkPermission'Modul', Instance, ACCESSRIGHTS) which does what the pnsecauthaction did.
--
campertoday.nl, Module development, Dutch Zikula Community -
- Rank: Helper
- Registered: Dec 31, 1969
- Last visit: May 20, 2010
- Posts: 524
-
- Rank: Softmore
- Registered: May 30, 2005
- Last visit: May 31, 2010
- Posts: 340
Looks like his answer is complete. Here is a code sample if it helps.
Code
if (!SecurityUtil::checkPermission('StrainID::', "::", ACCESS_EDIT)) {
LogUtil::registerError( _MODULENOAUTH);
return false;
} -
- Rank: Helper
- Registered: Dec 31, 1969
- Last visit: May 20, 2010
- Posts: 524
-
- Rank: Developer
- Registered: Aug 23, 2003
- Last visit: May 31, 2010
- Posts: 1428
I missed a parenthesis indeed
I thought that would go unnoticed
BTW Also in the templates you can use the securityutil statement.
For example:
Code
<!--[securityutil_checkpermission component='Stories::Story' instance='::' level='ACCESS_EDIT' assign='authedit']-->
You can then use the authedit variable in the template to check for editing rights.
--
campertoday.nl, Module development, Dutch Zikula Community -
- Rank: Developer
- Registered: Dec 31, 1969
- Last visit: Jun 01, 2010
- Posts: 6859
Okay, so I'm trying to work with this now...
I'm running 1.2.1 & pagemaster .4-RC1
In the template to display the publication I have
Code
<!--[securityutil_checkpermission comp="pagemaster::" inst="$core_tid:$core_pid:" level=ACCESS_EDIT assign="perm"]-->
<!--[if $perm]--><br />
<a href="<!--[pnmodurl modname='pagemaster' func='pubedit' tid=$core_tid pid=$core_pid]-->&goback=1"><!--[gt text='Edit This']--></a>
<!--[/if]-->
I have the 2nd permission (first under admin) as
Staff pagemaster:: pagemaster:: .* .* Edit access
I have the user in the staff group
I, as admin can see the edit link and it works. Staff doesn't see it.
--
Home Page | Find on Facebook | Follow on Twitter
-
- Rank: Developer
- Registered: Aug 23, 2003
- Last visit: May 31, 2010
- Posts: 1428
The parameters should be written out completely, so component and instance and not abbreviated as far as I can see in the code.
edited by: espaan, datetimebrief
--
campertoday.nl, Module development, Dutch Zikula Community -
- Rank: Developer
- Registered: Dec 31, 1969
- Last visit: Jun 01, 2010
- Posts: 6859
Change it, edit still not showing to staff.Code
<!--[$body|pnvarprephtmldisplay]-->
<!--[securityutil_checkpermission component="pagemaster::" instance="$core_tid:$core_pid:" level=ACCESS_EDIT assign="perm"]-->
<!--[if $perm]--><br />
<a href="<!--[pnmodurl modname='pagemaster' func='pubedit' tid=$core_tid pid=$core_pid]-->"><!--[gt text='Edit This']--></a>
<!--[/if]-->
edited by: HalbrookTech, datetimebrief
--
Home Page | Find on Facebook | Follow on Twitter
-
- Rank: Developer
- Registered: Dec 31, 1969
- Last visit: Jun 01, 2010
- Posts: 6859
BAH Chrome evidently logged my staff user account out. Need to put a Staff menu together I think, at least that way I have a visual cue in the menu that the staffer isn't logged in.
--
Home Page | Find on Facebook | Follow on Twitter
-
- Rank: Team Member
- Registered: Sep 06, 2006
- Last visit: May 09, 2010
- Posts: 2446
-
- Rank: Developer
- Registered: Dec 31, 1969
- Last visit: Jun 01, 2010
- Posts: 6859
nestormateo
Hehehehe
or just a theme note on the top
Yeah, that's not gonna work so well, if I do that, then they'll get confused. Now if I could just do in-line editing like in news, it'd be even better for them, then the page doesn't change.
--
Home Page | Find on Facebook | Follow on Twitter
-
- Rank: Team Member
- Registered: Sep 06, 2006
- Last visit: May 09, 2010
- Posts: 2446
Quote
at least that way I have a visual cue in the menu that the staffer isn't logged in.
I meant, to know who's logged in
--
- Mateo T. -
Mis principios... son mis fines
- Moderated by:
- Support
