Cake ACL component and ownership concept

I work with Cake Auth / ACL components. I read the documents and I did the study guide, but I'm still not satisfied with what I really can do with it. I saw a couple others , but I can’t say that I really have a winner. In any textbook / blog / document, I read that “ownership” is not accurately covered.

I was hoping to describe my use case, and if anyone who can suggest an approach, I’m all ears, otherwise I just need to try to do something myself: o)


This basically mimics a simple set of Dr. offices

Easy to launch for AROs:

  • Group 1: administrators (of course)
  • Group 2: Guardians
  • Group 3: participants

There is a “hasOne” relationship between groups and users (that is, a user can only belong to one group).

Now we use a tree structured by ACO, for example, Aidan Lister considers :

/root
    /practice
        /practice_profile
        /practice_updates
        /patients
            /entries
            /profiles
            /other_things

Each caretaker will have access to a practice that includes his patients. This gives the observer access to everything that the patient writes. In addition, the patient will ONLY be able to see / edit / etc. All that he has. This was not specifically described in any letter I read. I know that file permission types are common, but I don’t even want to go this way ...

Auth/ACL Cake . , ", X, Y." , , members, , caretakers .

- ? ? ?

EDIT: , , . , , , . , , , "" . , AHA, cakeqs. .

+3
2

, . acos CMS, . , -, model, , .

 id    parent_id  model  foreign_key  alias          lft  rght
 1462  1176       page   NULL         about-us       285  286 #display page url
 1515  1176       page   NULL         leo-test       291  292 #display page url
 1195  1176       NULL   NULL         ajaxSetStatus  261  262 #function
 1194  1176       NULL   NULL         walkTree       259  260 #function

- , , ( , ):

function view($url=null)
{
    $nD = $this->NodeDescriptor->findByUrl($url);
    if(!$nD) $this->redirect(array('action'=>'error'));
    $user = ($this->Auth->user())?$this->Auth->user():'Anonymous';
    if(!$this->Acl->check($user,"{$url}"))
        $this->redirect($this->referer());
 ...
+1

ACL, actionMap, "editown".

editown

+1

Source: https://habr.com/ru/post/1758325/


All Articles