mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
[wip] Create the permissions view
This commit is contained in:
parent
99e87a0b6e
commit
e539df5268
4 changed files with 99 additions and 0 deletions
|
@ -101,6 +101,10 @@ button {
|
|||
color: transparent;
|
||||
}
|
||||
|
||||
.label {
|
||||
border-radius: 1px;
|
||||
}
|
||||
|
||||
/*
|
||||
* The top heading of the doc
|
||||
*
|
||||
|
@ -659,6 +663,34 @@ input[type='radio'].nice-radio {
|
|||
}
|
||||
|
||||
|
||||
/** Permissions View **/
|
||||
#view-permissions {
|
||||
.panel-body {
|
||||
h3 {
|
||||
margin-top:0;
|
||||
}
|
||||
.label-removable {
|
||||
display:inline-block;
|
||||
font-size:1.3em;
|
||||
color:#666;
|
||||
background-color:#ccc;
|
||||
margin-right:7px;
|
||||
margin-bottom:7px;
|
||||
.label-separator {
|
||||
margin-left:7px;
|
||||
color:white;
|
||||
}
|
||||
> a {
|
||||
color:white;
|
||||
text-decoration: none;
|
||||
}
|
||||
> a:hover {
|
||||
color:@label-danger-bg;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Flash messages **/
|
||||
#flashMessage {
|
||||
max-height: 120px;
|
||||
|
|
|
@ -5,6 +5,59 @@
|
|||
|
||||
var PASSWORD_MIN_LENGTH = 4;
|
||||
|
||||
/**
|
||||
* Permissions
|
||||
*
|
||||
*/
|
||||
|
||||
// List groups and permissions
|
||||
app.get('#/permissions', function (c) {
|
||||
c.api('/users/groups', function(data_groups) {
|
||||
//c.api('/users/permissions', function(data_permissions) {
|
||||
data = {
|
||||
'groups':[
|
||||
{
|
||||
'name': 'all_users',
|
||||
'all_users': "true",
|
||||
'users': ['ljf', 'john', 'camille', 'sam', 'eli', 'bob', 'sandra',
|
||||
'aaron', 'mike'],
|
||||
'permissions': ['Mail', 'XMPP']
|
||||
},
|
||||
{
|
||||
'name': 'members',
|
||||
'users': ['ljf', 'john', 'eli', 'bob', 'sandra',
|
||||
'aaron', 'mike'],
|
||||
'permissions': ['Mail', 'XMPP', 'Wekan', 'Wordpress (editor)']
|
||||
},
|
||||
{
|
||||
'name':'volunters',
|
||||
'users':['ljf', 'toto'],
|
||||
'permissions': []
|
||||
},
|
||||
{
|
||||
'name':'admins',
|
||||
'users':['ljf', 'toto'],
|
||||
'permissions': []
|
||||
}
|
||||
],
|
||||
'users_with_specific_permissions':[
|
||||
{
|
||||
'username': 'ljf',
|
||||
'permissions': ['Nextcloud']
|
||||
},
|
||||
{
|
||||
'username': 'toto',
|
||||
'permissions': ['Nextcloud']
|
||||
}
|
||||
],
|
||||
'users': ['ljf', 'toto', 'titi', 'tutu', 'tata'],
|
||||
'permissions': ['Mail', 'XMPP', 'Wekan', 'nextcloud']
|
||||
};
|
||||
c.view('user/user_permission', data);
|
||||
//});
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* Users
|
||||
*
|
||||
|
@ -235,4 +288,7 @@
|
|||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
})();
|
||||
|
|
|
@ -158,6 +158,7 @@
|
|||
"gateway": "Gateway: ",
|
||||
"good_practices_about_admin_password": "You are now about to define a new admin password. The password should be at least 8 characters - though it is good practice to use longer password (i.e. a passphrase) and/or to use various kind of characters (uppercase, lowercase, digits and special characters).",
|
||||
"good_practices_about_user_password": "You are now about to define a new user password. The password should be at least 8 characters - though it is good practice to use longer password (i.e. a passphrase) and/or to use various kind of characters (uppercase, lowercase, digits and special characters).",
|
||||
"group": "Group",
|
||||
"home": "Home",
|
||||
"hook_adminjs_group_configuration": "System configurations",
|
||||
"hook_conf_cron": "Automatic tasks",
|
||||
|
@ -271,6 +272,13 @@
|
|||
"logs_share_with_yunopaste": "Share with YunoPaste",
|
||||
"logs_more": "Display more lines",
|
||||
"path_url": "Path",
|
||||
"perm_add_user": "Add a user",
|
||||
"perm_add_permission": "Add a permission",
|
||||
"perm_groups_new": "New group",
|
||||
"perm_manage_permissions": "Manage permissions",
|
||||
"perm_all_users_group_explanation": "This is a specific group containing all users registered on this instance",
|
||||
"perm_specific_permissions": "User specific permissions",
|
||||
"permissions": "Permissions",
|
||||
"port": "Port",
|
||||
"ports": "Ports",
|
||||
"postinstall": "Post-installation",
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
</div>
|
||||
|
||||
<div class="actions-group">
|
||||
<a href="#/permissions" class="btn btn-info">
|
||||
<span class="fa-key-modern"></span> {{t 'manage_permissions'}}
|
||||
</a>
|
||||
<a role="button" href="#/users/create" class="btn btn-success slide">
|
||||
<span class="fa-plus"></span> {{t 'users_new'}}
|
||||
</a>
|
||||
|
|
Loading…
Reference in a new issue