欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

关于zend_acl,该如何解决

程序员文章站 2024-02-07 11:24:10
...
关于zend_acl
用zend_acl ,把$acl最后生成的放到一个文件里,现在我把它反序列取出来,成为一个数组。但是我要取出单独一个角色和资源来判断非常麻烦,不知道大牛们是怎么做的,愿听指教。

PHP code

Zend_Acl Object
(
    [_roleRegistry:protected] => Zend_Acl_Role_Registry Object
        (
            [_roles:protected] => Array
                (
                    [guest] => Array
                        (
                            [instance] => Zend_Acl_Role Object
                                (
                                    [_roleId:protected] => guest
                                )

                            [parents] => Array
                                (
                                )

                            [children] => Array
                                (
                                    [member] => Zend_Acl_Role Object
                                        (
                                            [_roleId:protected] => member
                                        )

                                )

                        )

                    [member] => Array
                        (
                            [instance] => Zend_Acl_Role Object
                                (
                                    [_roleId:protected] => member
                                )

                            [parents] => Array
                                (
                                    [guest] => Zend_Acl_Role Object
                                        (
                                            [_roleId:protected] => guest
                                        )

                                )

                            [children] => Array
                                (
                                )

                        )

                    [admin] => Array
                        (
                            [instance] => Zend_Acl_Role Object
                                (
                                    [_roleId:protected] => admin
                                )

                            [parents] => Array
                                (
                                )

                            [children] => Array
                                (
                                )

                        )

                )

        )

    [_resources:protected] => Array
        (
            [entertain] => Array
                (
                    [instance] => Zend_Acl_Resource Object
                        (
                            [_resourceId:protected] => entertain
                        )

                    [parent] => 
                    [children] => Array
                        (
                        )

                )

            [sports] => Array
                (
                    [instance] => Zend_Acl_Resource Object
                        (
                            [_resourceId:protected] => sports
                        )

                    [parent] => 
                    [children] => Array
                        (
                        )

                )

            [news] => Array
                (
                    [instance] => Zend_Acl_Resource Object
                        (
                            [_resourceId:protected] => news
                        )

                    [parent] => 
                    [children] => Array
                        (
                        )

                )

        )

    [_isAllowedRole:protected] => 
    [_isAllowedResource:protected] => 
    [_isAllowedPrivilege:protected] => 
    [_rules:protected] => Array
        (
            [allResources] => Array
                (
                    [allRoles] => Array
                        (
                            [allPrivileges] => Array
                                (
                                    [type] => TYPE_DENY
                                    [assert] => 
                                )

                            [byPrivilegeId] => Array
                                (
                                )

                        )

                    [byRoleId] => Array
                        (
                        )

                )

            [byResourceId] => Array
                (
                    [entertain] => Array
                        (
                            [byRoleId] => Array
                                (
                                    [guest] => Array
                                        (
                                            [byPrivilegeId] => Array
                                                (
                                                    [watch] => Array
                                                        (
                                                            [type] => TYPE_ALLOW
                                                            [assert] => 
                                                        )

                                                )

                                            [allPrivileges] => Array
                                                (
                                                    [type] => 
                                                    [assert] => 
                                                )

                                        )

                                    [member] => Array
                                        (
                                            [byPrivilegeId] => Array
                                                (
                                                    [watch] => Array
                                                        (
                                                            [type] => TYPE_ALLOW
                                                            [assert] => 
                                                        )

                                                    [edit] => Array
                                                        (
                                                            [type] => TYPE_ALLOW
                                                            [assert] => 
                                                        )

                                                    [add] => Array
                                                        (
                                                            [type] => TYPE_ALLOW
                                                            [assert] => 
                                                        )

                                                )

                                            [allPrivileges] => Array
                                                (
                                                    [type] => 
                                                    [assert] => 
                                                )

                                        )

                                    [admin] => Array
                                        (
                                            [byPrivilegeId] => Array
                                                (
                                                    [watch] => Array
                                                        (
                                                            [type] => TYPE_ALLOW
                                                            [assert] => 
                                                        )

                                                    [edit] => Array
                                                        (
                                                            [type] => TYPE_ALLOW
                                                            [assert] => 
                                                        )

                                                    [add] => Array
                                                        (
                                                            [type] => TYPE_ALLOW
                                                            [assert] => 
                                                        )

                                                    [delete] => Array
                                                        (
                                                            [type] => TYPE_ALLOW
                                                            [assert] => 
                                                        )

                                                )

                                            [allPrivileges] => Array
                                                (
                                                    [type] => 
                                                    [assert] => 
                                                )

                                        )

                                )

                        )………………
)

 
关于zend_acl,该如何解决

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。

相关文章

相关视频