"Guest" access level in 1.6

30 views
Skip to first unread message

Denitz

unread,
Aug 5, 2009, 9:28:44 AM8/5/09
to Joomla! CMS Development
How can create "Guest" access level in new ACL?
It is used for i.e. module which should be shown for guests only and
hidden for all logged in users.

Andrew Eddie

unread,
Aug 5, 2009, 5:50:16 PM8/5/09
to joomla-...@googlegroups.com
http://www.theartofjoomla.com/home/19-designer/34-template-tip-hiding-joomla-modules-when-a-user-logs-in.html

Hope this helps.

Regards,
Andrew Eddie
http://www.theartofjoomla.com - the art of becoming a Joomla developer




2009/8/5 Denitz <sirdi...@gmail.com>:

Denitz

unread,
Aug 6, 2009, 9:52:57 AM8/6/09
to Joomla! CMS Development
That's template trick, not ACL-based solution.

I think we should have default group "Guest" with ID=0, or any other
predefined ID.
Guests have group_id=0 (or other predefined) by default, so we can
create "Guest" access level and add this group to this level.

"Guest" access level is a basic ACL feature and Joomla! definitely
should have this by default.


On Aug 6, 12:50 am, Andrew Eddie <mambob...@gmail.com> wrote:
> http://www.theartofjoomla.com/home/19-designer/34-template-tip-hiding...
>
> Hope this helps.
>
> Regards,
> Andrew Eddiehttp://www.theartofjoomla.com- the art of becoming a Joomla developer
>
> 2009/8/5 Denitz <sirdioni...@gmail.com>:

Andrew Eddie

unread,
Aug 6, 2009, 5:19:02 PM8/6/09
to joomla-...@googlegroups.com
Trick it may be, but I can guarantee you the code that it takes to do
that is insignificant to the code and changes that are required to
support exclusion access control on view rights. But hey, find
someone to sponsor the development of the feature, submit the patch
and I'm sure it would be accepted.

Regards,
Andrew Eddie
http://www.theartofjoomla.com - the art of becoming a Joomla developer




2009/8/6 Denitz <sirdi...@gmail.com>:

Denitz

unread,
Aug 7, 2009, 6:55:59 AM8/7/09
to Joomla! CMS Development
Andrew, I found that we don't need sponsors or even patches!
I sponsor the idea which takes 1-5 minutes to implement :)))

Just to add few rows to default 1.6 SQL !!! Here is what you need in
Backend:

1. Create group 'Guest' as child to 'Public'
2. Create access level 'Guest' in 'core' section, check 'Guest' group
for this level in 'User Groups Having Access'.
Now we have Guest group and Guest access level.

And here is the trick - we just add user with id=0 (guest user) to our
'Guest' group: my created 'Guest' group has id=10, so:
INSERT INTO `jos_user_usergroup_map` (`user_id`, `group_id`) VALUES(0,
10);

Ready.

Now you can setup 'Guest' level to i.e. module or menu item - and it
is shown only for guests only!
JAccess->getAuthorisedAccessLevels() identifies Guest and Public
levels for the guest user. 'Guest' group and level should be in
default Joomla! scheme.

Note that you may need to empty jos_session table for updating session
in the browser after adding this.

The only thing left - it will be fine to change the default ordering
of levels (change IDs):
1 - Public
2 - Guest
3 - Registered
4 - Special
5 - Confidential (?)




On Aug 7, 12:19 am, Andrew Eddie <mambob...@gmail.com> wrote:
> Trick it may be, but I can guarantee you the code that it takes to do
> that is insignificant to the code and changes that are required to
> support exclusion access control on view rights.  But hey, find
> someone to sponsor the development of the feature, submit the patch
> and I'm sure it would be accepted.
>
> Regards,
> Andrew Eddiehttp://www.theartofjoomla.com- the art of becoming a Joomla developer
>
> 2009/8/6 Denitz <sirdioni...@gmail.com>:
>
>
>
> > That's template trick, not ACL-based solution.
>
> > I think we should have default group "Guest" with ID=0, or any other
> > predefined ID.
> > Guests have group_id=0 (or other predefined) by default, so we can
> > create "Guest" access level and add this group to this level.
>
> > "Guest" access level is a basic ACL feature and Joomla! definitely
> > should have this by default.
>
> > On Aug 6, 12:50 am, Andrew Eddie <mambob...@gmail.com> wrote:
> >>http://www.theartofjoomla.com/home/19-designer/34-template-tip-hiding...
>
> >> Hope this helps.
>
> >> Regards,
> >> Andrew Eddiehttp://www.theartofjoomla.com-the art of becoming a Joomla developer

Hannes Papenberg

unread,
Aug 7, 2009, 2:56:25 PM8/7/09
to joomla-...@googlegroups.com
I agree with you Denitz and I'll look at how to implement this.

Hannes

Denitz schrieb:

Denitz

unread,
Aug 11, 2009, 4:19:11 AM8/11/09
to Joomla! CMS Development
Thanks, please contact me for any questions.
This simple but useful feature will make 1.6 ACL more robust.
> >> Andrew Eddiehttp://www.theartofjoomla.com-the art of becoming a Joomla developer
>
> >> 2009/8/6 Denitz <sirdioni...@gmail.com>:
>
> >>> That's template trick, not ACL-based solution.
>
> >>> I think we should have default group "Guest" with ID=0, or any other
> >>> predefined ID.
> >>> Guests have group_id=0 (or other predefined) by default, so we can
> >>> create "Guest" access level and add this group to this level.
>
> >>> "Guest" access level is a basic ACL feature and Joomla! definitely
> >>> should have this by default.
>
> >>> On Aug 6, 12:50 am, Andrew Eddie <mambob...@gmail.com> wrote:
>
> >>>>http://www.theartofjoomla.com/home/19-designer/34-template-tip-hiding...
>
> >>>> Hope this helps.
>
> >>>> Regards,
> >>>> Andrew Eddiehttp://www.theartofjoomla.com-theart of becoming a Joomla developer

Andrew Eddie

unread,
Aug 11, 2009, 5:16:58 AM8/11/09
to joomla-...@googlegroups.com
You're right Denitz, that might just work. I stand corrected. The
user with an ID of 0 is a problem but we may be able to work around
that.

Regards,
Andrew Eddie
http://www.theartofjoomla.com - the art of becoming a Joomla developer




2009/8/11 Denitz <sirdi...@gmail.com>:

Denitz

unread,
Aug 11, 2009, 12:01:29 PM8/11/09
to Joomla! CMS Development
Yes, we can't add user with id=0 to jos_users, but in fact we don't
need such user in this table.


On Aug 11, 12:16 pm, Andrew Eddie <mambob...@gmail.com> wrote:
> You're right Denitz, that might just work.  I stand corrected.  The
> user with an ID of 0 is a problem but we may be able to work around
> that.
>
> Regards,
> Andrew Eddiehttp://www.theartofjoomla.com- the art of becoming a Joomla developer
>
> 2009/8/11 Denitz <sirdioni...@gmail.com>:
> >> >> Andrew Eddiehttp://www.theartofjoomla.com-theart of becoming a Joomla developer
>
> >> >> 2009/8/6 Denitz <sirdioni...@gmail.com>:
>
> >> >>> That's template trick, not ACL-based solution.
>
> >> >>> I think we should have default group "Guest" with ID=0, or any other
> >> >>> predefined ID.
> >> >>> Guests have group_id=0 (or other predefined) by default, so we can
> >> >>> create "Guest" access level and add this group to this level.
>
> >> >>> "Guest" access level is a basic ACL feature and Joomla! definitely
> >> >>> should have this by default.
>
> >> >>> On Aug 6, 12:50 am, Andrew Eddie <mambob...@gmail.com> wrote:
>
> >> >>>>http://www.theartofjoomla.com/home/19-designer/34-template-tip-hiding...
>
> >> >>>> Hope this helps.
>
> >> >>>> Regards,
> >> >>>> Andrew Eddiehttp://www.theartofjoomla.com-theartof becoming a Joomla developer

Denitz

unread,
Aug 29, 2009, 6:01:27 AM8/29/09
to Joomla! CMS Development
Any news?

On Aug 11, 7:01 pm, Denitz <sirdioni...@gmail.com> wrote:
> Yes, we can't add user with id=0 to jos_users, but in fact we don't
> need such user in this table.
>
> On Aug 11, 12:16 pm, Andrew Eddie <mambob...@gmail.com> wrote:
>
> > You're right Denitz, that might just work.  I stand corrected.  The
> > user with an ID of 0 is a problem but we may be able to work around
> > that.
>
> > Regards,
> > Andrew Eddiehttp://www.theartofjoomla.com-the art of becoming a Joomla developer
>
> > 2009/8/11 Denitz <sirdioni...@gmail.com>:
>
> > > Thanks, please contact me for any questions.
> > > This simple but useful feature will make 1.6 ACL more robust.
>
> > > On Aug 7, 9:56 pm, Hannes Papenberg <hackwa...@googlemail.com> wrote:
> > >> I agree with you Denitz and I'll look at how to implement this.
>
> > >> Hannes
>
> > >> Denitz schrieb:
>
> > >> > Andrew, I found that we don't need sponsors or even patches!
> > >> > I sponsor the idea which takes 1-5 minutes to implement :)))
>
> > >> > Just to add few rows to default 1.6 SQL !!! Here is what you need in
> > >> > Backend:
>
> > >> > 1. Create group 'Guest' as child to 'Public'
> > >> > 2. Createaccesslevel 'Guest' in 'core' section, check 'Guest' group
> > >> > for this level in 'User Groups HavingAccess'.
> > >> > Now we haveGuestgroup andGuestaccesslevel.
>
> > >> > And here is the trick - we just add user with id=0 (guestuser) to our
> > >> > 'Guest' group: my created 'Guest' group has id=10, so:
> > >> > INSERT INTO `jos_user_usergroup_map` (`user_id`, `group_id`) VALUES(0,
> > >> > 10);
>
> > >> > Ready.
>
> > >> > Now you can setup 'Guest' level to i.e. module or menu item - and it
> > >> > is shown only for guests only!
> > >> > JAccess->getAuthorisedAccessLevels() identifiesGuestand Public
> > >> > levels for theguestuser. 'Guest' group and level should be in
> > >> > default Joomla! scheme.
>
> > >> > Note that you may need to empty jos_session table for updating session
> > >> > in the browser after adding this.
>
> > >> > The only thing left - it will be fine to change the default ordering
> > >> > of levels (change IDs):
> > >> > 1 - Public
> > >> > 2 -Guest
> > >> > 3 - Registered
> > >> > 4 - Special
> > >> > 5 - Confidential (?)
>
> > >> > On Aug 7, 12:19 am, Andrew Eddie <mambob...@gmail.com> wrote:
>
> > >> >> Trick it may be, but I can guarantee you the code that it takes to do
> > >> >> that is insignificant to the code and changes that are required to
> > >> >> support exclusionaccesscontrol on view rights.  But hey, find
> > >> >> someone to sponsor the development of the feature, submit the patch
> > >> >> and I'm sure it would be accepted.
>
> > >> >> Regards,
> > >> >> Andrew Eddiehttp://www.theartofjoomla.com-theartof becoming a Joomla developer
>
> > >> >> 2009/8/6 Denitz <sirdioni...@gmail.com>:
>
> > >> >>> That's template trick, not ACL-based solution.
>
> > >> >>> I think we should have default group "Guest" with ID=0, or any other
> > >> >>> predefined ID.
> > >> >>> Guests have group_id=0 (or other predefined) by default, so we can
> > >> >>> create "Guest"accesslevel and add this group to this level.
>
> > >> >>> "Guest"accesslevel is a basic ACL feature and Joomla! definitely
> > >> >>> should have this by default.
>
> > >> >>> On Aug 6, 12:50 am, Andrew Eddie <mambob...@gmail.com> wrote:
>
> > >> >>>>http://www.theartofjoomla.com/home/19-designer/34-template-tip-hiding...
>
> > >> >>>> Hope this helps.
>
> > >> >>>> Regards,
> > >> >>>> Andrew Eddiehttp://www.theartofjoomla.com-theartofbecoming a Joomla developer
>
> > >> >>>> 2009/8/5 Denitz <sirdioni...@gmail.com>:
>
> > >> >>>>> How can create "Guest"accesslevel in new ACL?
Reply all
Reply to author
Forward
0 new messages