OMEKA에서 ACL(접근제어목록) 커스텀을 위한 라이브러리

오메카에서 페이지 보기, 파일 보기, 관리자 모드 기능 등의 기본 접근 권한을 수정하거나 기존 페이지 외에 추가 페이지를 새로 만들 경우 커스텀해야 하는 라이브러리의 경로와 파일명은 다음과 같습니다.

/application/libraries/Omeka/Application/Resource/Acl.php

위 파일을 편집하면 오메카의 사용자(Super User, Admin, Researcher, Contributor)별 제공되는 기능 사용 권한을 커스텀 제어할 수 있습니다. 예를 들어 아래의 코드에서 볼 수 있듯이 Super User(최고관리자)가 아닌 Admin(일반관리자) 유저나 Contributor(기증자)의 기본 접근 권한을 상향 또는 하향 조정할 수 있습니다.


        // Super users have full privileges.
        $acl->allow('super');
        // Researchers can view and search items and collections that are not public.
        $acl->allow('researcher', array('Items', 'Collections', 'Search'), 'showNotPublic');
        // Contributors can add and tag items, edit or delete their own items, and see
        // their items that are not public.
        $acl->allow('contributor', 'Items', array('add', 'tag', 'batch-edit', 'batch-edit-save',
                                                  'change-type', 'delete-confirm', 'editSelf',
                                                  'deleteSelf', 'showSelfNotPublic'));
        // Contributors can edit their own files.
        $acl->allow('contributor', 'Files', 'editSelf');
        // Contributors have access to tag autocomplete.
        $acl->allow('contributor', 'Tags', array('autocomplete'));
        // Contributors can add collections, edit or delete their own collections, and
        // see their collections that are not public.
        $acl->allow('contributor', 'Collections', array('add', 'delete-confirm', 'editSelf',
                                                       'deleteSelf', 'showSelfNotPublic'));
        $acl->allow('contributor', 'Elements', 'element-form');

        // Define deny rules.

        // Deny admins from accessing some resources allowed to super users.
        $acl->deny('admin', array('Settings', 'Plugins', 'Themes', 'ElementSets',
                                  'Security', 'SystemInfo'));
        // Deny admins from deleting item types and item type elements.
        $acl->deny('admin', 'ItemTypes', array('delete', 'delete-element'));

        // Deny Users to admins since they normally have all the super permissions.
        $acl->deny(null, 'Users');
        $acl->allow(array('super', 'admin', 'contributor', 'researcher'), 'Users', null,
                    new Omeka_Acl_Assert_User);

        // Always allow users to login, logout and send forgot-password notifications.
        $acl->allow(array(null, 'admin'), 'Users', array('login', 'logout', 'forgot-password', 'activate'));


이외에도 전시(Exhibits)나 일반HTML페이지(Simple Pages) 같은 플러그인 또는 테마(/themes) 디렉토리에 들어 있는 Items 또는 Collections 디렉토리 하위 등에 기본적으로 제공되는 show나 browse 같은 페이지 외에 별도의 기능을 제공하는 새로운 페이지를 만들 때도 ACL을 편집해야 웹을 통해 정상 출력될 수 있습니다. 접근통제가 되어 있지 않은 페이지는 일반 이용자들은 내용을 볼 수 없습니다.
만약 어떤 기관의 요구사항이 외부 서버에서 시스템을 구동하되 관리자 권한의 사용자 외에는 페이지의 접근을 모두 통제해야 한다면 ACL을 커스텀해서 일반 이용자의 접근을 막을 수 있습니다.

참고로 ExhibitBuilder 같은 플러그인인 경우엔 플러그인 디렉토리내에 ACL 설정을 편집할 수 있는 파일(ex: functions.php)이 들어 있습니다.

Sign In or Register to comment.