summaryrefslogtreecommitdiffstats
path: root/install/ui/src/freeipa/webui.js
blob: f6c3339ec4b5d3fb8a4cb547407eebf2a19b45af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/*  Authors:
 *    Pavel Zuna <pzuna@redhat.com>
 *    Endi S. Dewata <edewata@redhat.com>
 *
 * Copyright (C) 2010 Red Hat
 * see file 'COPYING' for use and warranty information
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

define(['./ipa'], function(IPA) {

/* tabs definition for IPA webUI */

IPA.admin_navigation = function(spec) {

    spec = spec || {};

    spec.name = 'admin';

    spec.tabs = [
        {name: 'identity', label: IPA.messages.tabs.identity, children: [
            {entity: 'user'},
            {entity: 'group'},
            {entity: 'host'},
            {entity: 'hostgroup'},
            {entity: 'netgroup'},
            {entity: 'service'},
            {name:'dns', label: IPA.messages.tabs.dns, children:[
                 {entity: 'dnszone'},
                 {entity: 'dnsconfig'},
                 {entity: 'dnsrecord', hidden:true}
             ]
            }
        ]},
        {name: 'policy', label: IPA.messages.tabs.policy, children: [
            {name: 'hbac', label: IPA.messages.tabs.hbac, children: [
                 {entity: 'hbacrule'},
                 {entity: 'hbacsvc'},
                 {entity: 'hbacsvcgroup'},
                 {entity: 'hbactest'}
            ]},
            {name: 'sudo', label: IPA.messages.tabs.sudo, children: [
                 {entity: 'sudorule'},
                 {entity: 'sudocmd'},
                 {entity: 'sudocmdgroup'}
            ]},
            {name:'automount',
             label: IPA.messages.tabs.automount,
             children:[
                {entity: 'automountlocation', hidden:true, depth: -1},
                {entity: 'automountmap', hidden: true, depth: -1},
                {entity: 'automountkey', hidden: true, depth: -1}]},
            {entity: 'pwpolicy'},
            {entity: 'krbtpolicy'},
            {entity: 'selinuxusermap'},
            {name: 'automember', label: IPA.messages.tabs.automember,
             children: [
                { name: 'amgroup', entity: 'automember',
                  facet: 'searchgroup', label: IPA.messages.objects.automember.usergrouprules},
                { name: 'amhostgroup', entity: 'automember',
                  facet: 'searchhostgroup', label: IPA.messages.objects.automember.hostgrouprules}
            ]}
        ]},
        {name: 'ipaserver', label: IPA.messages.tabs.ipaserver, children: [
            {name: 'rolebased', label: IPA.messages.tabs.role, children: [
                 {entity: 'role'},
                 {entity: 'privilege'},
                 {entity: 'permission'}
             ]},
            {entity: 'selfservice'},
            {entity: 'delegation'},
            {entity: 'idrange'},
            {entity: 'trust'},
            {entity: 'config'}
        ]}];

    var that = IPA.navigation(spec);

    return that;
};

IPA.self_serv_navigation = function(spec) {

    spec = spec || {};

    spec.name = 'self-service';

    spec.tabs = [
        {name: 'identity', label: IPA.messages.tabs.identity, children: [
            {entity: 'user'}
        ]}];

    var that = IPA.navigation(spec);

    that.update = function() {
        var pkey = that.get_state('user-pkey');
        var facet = that.get_state('user-facet');

        if (pkey && facet) {
            that.navigation_update();

        } else {
            var state = {
                'navigation': 'identity',
                'identity': 'user',
                'user-pkey': pkey || IPA.whoami_pkey,
                'user-facet': facet || 'details'
            };
            that.push_state(state);
        }
    };

    return that;
};

return {};
});