Welcome, Guest
Username: Password: Remember me

TOPIC: Special authoring / group access

Special authoring / group access 23 Apr 2012 07:13 #2105

  • tr4ding
  • tr4ding's Avatar
  • Offline
  • Senior Member
  • Posts: 42
  • Karma: 1
Here is my steps:

1. I create a table Project in my project (sorry for my play on words) with this field:

- name (string)

2. I add wizard "publish" and "author" that creates two fields:

- Author
- Publish

3. In my local Joomla istance, I created a new group linked to Registered, in order to inherit its credential and get access also in backend.....

4. I create a new user and I linked it both to Registered group and the new one....

5. In the Global configuration of Joomla, section Permissions, I gave to the new group the access of LOGIN ADMINISTRATION.

6. In USERS
>ACCESS LEVELS I create a news level in order to replace SPECIAL level for this modules:

- Quick Icons
- Admin Menu
- Toolbar
- Admin Submenu
- Titles

7. Now my new group is able to see the backend....

8. I installed my component and in OPTIONS
>PERMISSIONS for my new group I set theese options:

- Create: Allow
- View own: Allow
- Edit own: Allow
- Delete own: Allow

9. I tried to create a content in that table with a superuser account (admin), but it can be seen by the other group. By telling the truth, the content can't be modified, but I'm interested also in viewing.....

Any clues? Am I missing something?

Thank you for your support!!!!
Last Edit: 24 Apr 2012 07:05 by admin.
The administrator has disabled public write access.

Re: Authoring problems 23 Apr 2012 07:28 #2106

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
Hi,

To make it easier to understand your problem, please post the current REAL acl in use.

TODO :
In your concerned layout, or view.html.php :
echo("<pre>"); print_r($access); echo("</pre>");  // DBG temp VAR DUMP
exit();

So, you first check if the ACL are in place as it should be.

Maybe there is an issue, but to check it, it is more easy to debug with this first step.
Coding is now a piece of cake
The administrator has disabled public write access.

Re: Authoring problems 23 Apr 2012 07:35 #2107

  • tr4ding
  • tr4ding's Avatar
  • Offline
  • Senior Member
  • Posts: 42
  • Karma: 1
Here is the dump:
JObject Object
(
    [_errors:protected] => Array
        (
        )

    [core.admin] => 
    [core.manage] => 1
    [core.create] => 1
    [core.delete] => 
    [core.edit] => 
    [core.edit.state] => 
    [core.view.own] => 1
    [core.edit.own] => 1
    [core.delete.own] => 1
)

Is what you expected?
The administrator has disabled public write access.

Re: Authoring problems 23 Apr 2012 07:48 #2108

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
Well perfect.


I read again your post.
If the Super User is the author of the content, you cannot allow another user to see it until it is published.


To allow a particular group to see, here what you have to do :

MODEL (both item and collection) :

in the populateParams() function, you can see these types of initialization :
$item->params->set('access-view', true);


These inits are the individual ACL for the item in use.
You can add another rule ('access-group-view' for instance)

Write the code that correspond to this. (Try to find by yourself...)

You will be able to check them wherever in your component using :
if ($myObjectItem->params->get('access-group-view'))
{
	...
}


But you can also do everyting in model, after the params init :
//propagate the rights automatically (for view)
if ($item->params->set('access-group-view'))
	$item->params->set('access-view', true);

Do the same for edit, delete, ...

Hope I am clear.

Don't hesitate to ask if you don't understand.
Coding is now a piece of cake
Last Edit: 23 Apr 2012 07:53 by admin.
The administrator has disabled public write access.

Re: Authoring problems 23 Apr 2012 07:59 #2109

  • tr4ding
  • tr4ding's Avatar
  • Offline
  • Senior Member
  • Posts: 42
  • Karma: 1
admin wrote:
Well perfect.


I read again your post.
If the Super User is the author of the content, you cannot allow another user to see it until it is published.


To allow a particular group to see, here what you have to do :

My case study is that this particular group I created must not see contents created by super users.....not the opposite.....

The roadmap you propose me it's the same in my case?

Thank you!!
The administrator has disabled public write access.

Re: Authoring problems 23 Apr 2012 08:11 #2110

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
Exactly the same.

Instead of :
//propagate the rights automatically (for view)
if ($item->params->set('access-group-view'))
	$item->params->set('access-view', true);

Write :
//propagate the rights automatically (for view)
if (!$item->params->set('access-group-view'))
	$item->params->set('access-view', false);


Will it be ok to write the source that check the registration of the current user to the particular group ?
Coding is now a piece of cake
The administrator has disabled public write access.

Re: Authoring problems 23 Apr 2012 08:21 #2111

  • tr4ding
  • tr4ding's Avatar
  • Offline
  • Senior Member
  • Posts: 42
  • Karma: 1
admin wrote:
To allow a particular group to see, here what you have to do :

MODEL (both item and collection) :

in the populateParams() function, you can see these types of initialization :
$item->params->set('access-view', true);


These inits are the individual ACL for the item in use.
You can add another rule ('access-group-view' for instance)

Write the code that correspond to this. (Try to find by yourself...)

You will be able to check them wherever in your component using :
if ($myObjectItem->params->get('access-group-view'))
{
	...
}

Sorry for my newbie questions, but how can I find the code corresponding to the "access-view" in order to write my own code for the access-group-view ?
admin wrote:
Exactly the same.

Instead of :
//propagate the rights automatically (for view)
if ($item->params->set('access-group-view'))
	$item->params->set('access-view', true);

Write :
//propagate the rights automatically (for view)
if (!$item->params->set('access-group-view'))
	$item->params->set('access-view', false);


Will it be ok to write the source that check the registration of the current user to the particular group ?

It would be perfect!!!

Thanks so much! I hope not to waste your time!
The administrator has disabled public write access.

Re: Authoring problems 26 Apr 2012 04:51 #2143

  • tr4ding
  • tr4ding's Avatar
  • Offline
  • Senior Member
  • Posts: 42
  • Karma: 1
Hi!!

How can I search on Internet in order to write my own access-group-view ?

Sorry, but I'm a newbie :(
The administrator has disabled public write access.

Re: Authoring problems 09 May 2012 03:39 #2292

  • tr4ding
  • tr4ding's Avatar
  • Offline
  • Senior Member
  • Posts: 42
  • Karma: 1
admin wrote:
Well perfect.

To allow a particular group to see, here what you have to do :

MODEL (both item and collection) :

in the populateParams() function, you can see these types of initialization :
$item->params->set('access-view', true);


These inits are the individual ACL for the item in use.
You can add another rule ('access-group-view' for instance)

Write the code that correspond to this. (Try to find by yourself...)

I'm really sorry to bother you, but I'm unable to find a clue in order to write my own rule :(

Could you help me against this "war"? :)

Thank you so much in advance :)
The administrator has disabled public write access.
Time to create page: 0.131 seconds

Get Started