Forums

J!2.5 and user permissions

?
Guest 12 Apr, 2012
hi there,

I am in the process of migrating my forms from J!1.5 to J!2.5 and came across the following prob:
when listing the articles created by the logged in user in J!1.5 I was using the following snippet in the where clause of a record loader:
<?php $user =& JFactory::getUser(); ?>
<?php if ($user->gid < '23') : ?>
Model.created_by = '<?php echo $user->id; ?>'
<?php endif; ?>

could somebody pls give me a hint on how to achieve this with J!2.5?
GreyHead 13 Apr, 2012
Hi GabrielaH,

The problem here is that Joomla! changed the User Group structure completely in Joomla! 2.5. It looks as though this code is testing for users who are not admins. You can no longer do that by checking gids. In fact I'm not sure that it means anything much any more as there isn't a clear user group hierarchy. You may need to check instead for specific permissions.

What do you actually need to test?

Bob
This topic is locked and no more replies can be posted.