comparison cpack/dml/config-available/dml_permission.pl @ 0:718306e29690 tip

commiting public release
author Daniel Wolff
date Tue, 09 Feb 2016 21:05:06 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:718306e29690
1 /* Part of DML (Digital Music Laboratory)
2 Copyright 2014-2015 Samer Abdallah, University of London
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public
15 License along with this library; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19 :- module(dml_permissions, [file_permission/2]).
20
21 /** <module> control public access to DML resources
22 */
23
24 %% file_permission(+File,-Permission:oneof([public,user,private])) is det.
25 % This predicate is called to check whether or not the contents of a given
26 % file should be available. There are three levels of access:
27 % * public
28 % Accessible to everyone.
29 % * user
30 % Accessible to registered, logged in Cliopatria users.
31 % * private
32 % Accessible to no-one.
33 % The default level is private for all files. If you wish to make some files
34 % available, you must copy (not link) this file to the 'config-available' directory
35 % of your Cliopatria installation and edit the definition of file_permission/2
36 % as you see fit.
37
38 %file_permission(Path,public) :- atom_concat('/home/dml/lib/mazurka/',_,Path), !.
39 file_permission(_,public) :- user_db:logged_on(admin).
40 file_permission(_,private).
41