Welcome Guest, Not a member yet? Register   Sign In
Khaos :: KhACL
#71

[eluser]dmitrybelyakov[/eluser]
Hi, thank you for this very useful contribution to CI.
I just have one question - is there any way to get ARO's parent ARO, in other words - to get user's group.

Thank you.
#72

[eluser]Pascal Kriete[/eluser]
This is really nice. I would love to use it for SimplyPost (saves me some work), but I'm hesitant to include unlicensed code. Any chance we could have a license?
#73

[eluser]dmitrybelyakov[/eluser]
One more addition to the post i made earlier here:

As i understood the ACO are stored in a tree structure as my website tree is. So i just duplicate my website tree structure with ACO objects. Is this correct?

And then what about sorting tree elements? Is there a way to sort AСOs tree? In my own website tree i don’t use nested sets structure - so i just change the element’s parent - and the whole underlying branch is moved. How can i do the same with AСO tree?
Thank you.
#74

[eluser]Neophyte[/eluser]
@inparo - I was thinking of maybe using the BSD license as i really dont mind how the code is used or edited.

@dmitrybelyakov - It really is entirely upto you how you create your ACO tree so some people may copy the admin side of their sites structure as ACOs for maximum control but only parts of the public side were some restrictions need to be applied.

There is currently no built in method for moving branches of the tree within the ACOs and AROs but now the check side of the acl is in its own seperate helper i'll likely start adding these sorts of utility methods to the library as it will no longer effect the generation time of general page views, any suggestions/requests asside from move ?
#75

[eluser]codex[/eluser]
[quote author="Craig Rodway" date="1201650177"]Can't wait to see a bit more of the flesh you mentioned and how it might be used in a small 'real-world' example application.[/quote]

Second that. I *think* I understand how this works but it would be very useful to see a small controller/view example of the usage.
#76

[eluser]adamp1[/eluser]
I was just trying the new version and in the helper file you use static variable declarations. If I am not wrong these are PHP5 only? Wouldn't it be better not to use them so a large part of the community can use your library.

(I do believe their PHP4 only, my eclipse is telling me that)
#77

[eluser]Neophyte[/eluser]
within the scope of a function/method the static keyword works fine on variables (i use it in PHP4 myself at work) for PHP5 final, private, protected and static were added to the object side of things so you can use them on properties and method declerations.
#78

[eluser]Stylec[/eluser]
Hi, I seem to be having a problem gettings this working.

I've set up the database and tables and can use the example code to create the objects in them, but when i run the code

Code:
<?php

class Welcome extends Controller {

    function Welcome()
    {
        parent::Controller();    
    }
    
    function index()
    {
        $this->load->helper('Khacl');
            
        echo $allowed = kh_acl_check('neophyte', 'news', 'comment');
    }
}

I get this error

Code:
A Database Error Occurred
Error Number: 1054

Unknown column 'aro_node.lft' in 'on clause'

SELECT access.allow FROM khacl_aros AS aro_node, khacl_acos AS aco_node LEFT JOIN khacl_aros AS aro_branch ON (aro_node.lft >= aro_branch.lft AND aro_node.lft <= aro_branch.rgt) LEFT JOIN khacl_acos AS aco_branch ON (aco_node.lft >= aco_branch.lft AND aco_node.lft <= aco_branch.rgt) INNER JOIN khacl_access AS access ON (aro_branch.id = access.aro_id AND aco_branch.id = access.aco_id) WHERE aro_node.name = 'neophyte' AND aco_node.name = 'news' ORDER BY aro_branch.rgt ASC, aco_branch.rgt ASC LIMIT 1

Any ideas what I could be doing wrong?

Thanks
#79

[eluser]bardelot[/eluser]
you have to add some brackets in the sql query (FROM section) in the khacl helper.

line 68:
Code:
FROM ('.$ci->db->dbprefix.$tables['aros'].' AS aro_node, '.$ci->db->dbprefix.$tables['acos'].' AS aco_node)

line 87:
Code:
FROM ('.$ci->db->dbprefix.$tables['aros'].' AS aro_node, '.$ci->db->dbprefix.$tables['acos'].' AS aco_node, '.$ci->db->dbprefix.$tables['axos'].' AS axo_node)
#80

[eluser]Stylec[/eluser]
Thanks, this seems to have fixed it.




Theme © iAndrew 2016 - Forum software by © MyBB