The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Rocket.Chat/packages/rocketchat-ui-admin/admin/admin.html

198 lines
7.4 KiB

<template name="admin">
<section class="page-container page-home page-static page-settings">
<head class="fixed-title">
{{> burger}}
11 years ago
<h2>
<span class="room-title">{{#with group}}{{label}}{{/with}}</span>
11 years ago
</h2>
</head>
<div class="content">
Create RocketChat authorization package that handles role and permission based authorization Leverages alanning:roles package to associate a user to a role. Uses alanning:roles optional "group" parameter to limit the role's scope to either the global level or room level. The global level is applicable to users that can perform administrative functions. The room level is applicable to users that can perform room specific administrative functions (like a moderator). A role can have zero or more permissions. Permissions and their association to roles are defined by this package Authorization checks are based on whether or not the user has a role or permission. The roles, permissions, and their association are statically defined at this time. Eventually, there should be an API to dynamically create a role and associate it to static permission(s). Old 'isAdmin' and '.admin is true' checks have been replaced with corresponding hasPermission authorization checks. Additionally, code that automatically assigned admin privileges are updated to assign 'admin' role instead. channel/direct message/private group code checks authorization to edit properties (e.g. title) and edit/delete messages (regardless of the system level allow edit/delete settings). - user with 'admin' role are authorized to do anything - room creator is assigned 'moderator' role that can edit the room and edit/delete messages - members can only edit/delete their own messages IF system wide settings permit them to. v19 migration will - add 'admin' role to users with admin:true property - add 'moderator' role scoped to room for room creators - add 'user' role to all users. There are known issues unrelated to the changes made - If a user with edit/delete message room permissions logs out then a user without edit/delete message room permissions logs in, then they will see edit/delete icons. The server will deny execution - edit/delete icons are not reactive Thus if the system level allow edit/delete message setting is toggled, the icons will not reflect it. The server will deny execution.
10 years ago
{{#unless hasPermission 'view-privileged-setting'}}
<p>{{_ "You_are_not_authorized_to_view_this_page"}}</p>
11 years ago
{{else}}
{{#with group}}
{{#if description}}
<div class="info">
<p class="settings-description">{{description}}</p>
</div>
{{/if}}
{{/with}}
11 years ago
<div class="rocket-form">
{{#each sections}}
<div class="section {{#if section}}section-collapsed{{/if}}">
{{#if section}}
<div class="section-title">
<div class="section-title-text">
{{translateSection section}}
</div>
<div class="section-title-right">
<button class="button secondary expand"><span>{{_ "Expand"}}</span></button>
</div>
</div>
{{/if}}
<div class="section-content">
{{#if section}}
10 years ago
{{#if sectionIsCustomOAuth section}}
<div class="section-helper">
{{#with callbackURL section}}
{{{_ "Custom_oauth_helper" .}}}
{{/with}}
</div>
{{/if}}
{{/if}}
{{#each settings}}
<div class="input-line double-col {{#if changed}}setting-changed{{/if}}" {{isDisabled}}>
<label>{{label}}</label>
<div>
{{#if $eq type 'string'}}
{{#if multiline}}
<textarea class="input-monitor" name="{{_id}}" rows="4" style="height: auto" {{isDisabled}}>{{value}}</textarea>
{{else}}
<input class="input-monitor" type="text" name="{{_id}}" value="{{value}}" placeholder="{{placeholder}}" {{isDisabled}}/>
10 years ago
{{/if}}
{{/if}}
{{#if $eq type 'relativeUrl'}}
<input class="input-monitor" type="text" name="{{_id}}" value="{{relativeUrl value}}" placeholder="{{placeholder}}" {{isDisabled}} {{isReadonly}}/>
{{/if}}
{{#if $eq type 'password'}}
<input class="input-monitor" type="password" name="{{_id}}" value="{{value}}" placeholder="{{placeholder}}" {{isDisabled}}/>
{{/if}}
{{#if $eq type 'int'}}
<input class="input-monitor" type="number" name="{{_id}}" value="{{value}}" placeholder="{{placeholder}}" {{isDisabled}}/>
{{/if}}
{{#if $eq type 'boolean'}}
<label><input class="input-monitor" type="radio" name="{{_id}}" value="1" checked="{{$eq value true}}" {{isDisabled}}/> {{_ "True"}}</label>
<label><input class="input-monitor" type="radio" name="{{_id}}" value="0" checked="{{$eq value false}}" {{isDisabled}}/> {{_ "False"}}</label>
{{/if}}
{{#if $eq type 'select'}}
<select class="input-monitor" name="{{_id}}" {{isDisabled}}>
{{#each values}}
<option value="{{key}}" selected="{{selectedOption ../_id key}}">{{_ i18nLabel}}</option>
{{/each}}
</select>
{{/if}}
{{#if $eq type 'language'}}
<select class="input-monitor" name="{{_id}}" {{isDisabled}}>
{{#each languages}}
<option value="{{key}}" selected="{{appLanguage key}}" dir="auto">{{name}}</option>
{{/each}}
</select>
{{/if}}
{{#if $eq type 'color'}}
<input class="input-monitor minicolors" type="text" name="{{_id}}" value="{{value}}" {{isDisabled}}/>
{{/if}}
{{#if $eq type 'font'}}
<input class="input-monitor" type="text" name="{{_id}}" value="{{value}}" {{isDisabled}}/>
{{/if}}
{{#if $eq type 'code'}}
{{#if isDisabled.disabled}}
{{> CodeMirror name=_id options=(getEditorOptions true) code=(i18nDefaultValue) }}
{{else}}
<div class="code-mirror-box" data-editor-id="{{_id}}">
<div class="title">
{{label}}
</div>
{{> CodeMirror name=_id options=getEditorOptions code=value }}
{{setEditorOnBlur _id}}
<div class="buttons">
<button class="button button-primary button-fullscreen">
Full Screen
</button>
<button class="button button-primary button-restore">
Exit Full Screen
</button>
</div>
</div>
{{/if}}
{{/if}}
{{#if $eq type 'action'}}
{{#if hasChanges section}}
<span style="line-height: 40px; color: #888;">{{_ "Save_to_enable_this_action"}}</span>
{{else}}
<button type="button" class="button primary action" data-setting="{{_id}}" data-action="{{value}}" {{isDisabled}}>{{_ actionText}}</button>
{{/if}}
{{/if}}
{{#if $eq type 'asset'}}
{{#if value.url}}
<div class="settings-file-preview">
<div class="preview" style="background-image:url({{value.url}}?_dc={{random}});"></div>
<div class="action">
<button type="button" class="button red delete-asset"><i class="icon-trash"></i>{{_ 'Delete'}}</button>
</div>
</div>
{{else}}
<div class="settings-file-preview">
<div class="preview no-file"><i class="icon-upload"></i></div>
<div class="action">
<div class="button primary">{{_ 'Select_file'}}
<input type="file" accept="{{assetAccept fileConstraints}}" />
</div>
</div>
</div>
{{/if}}
{{/if}}
9 years ago
{{#if $eq type 'roomPick'}}
<div>
{{> inputAutocomplete settings=autocompleteRoom id=_id name=_id class="search autocomplete" autocomplete="off" disabled=isDisabled.disabled}}
9 years ago
<ul class="selected-rooms">
{{#each selectedRooms}}
<li class="remove-room" data-setting={{../_id}}>{{name}} <i class="icon-cancel"></i></li>
9 years ago
{{/each}}
</ul>
</div>
{{/if}}
{{#if description}}
<div class="settings-description">{{{RocketChatMarkdown description}}}</div>
{{/if}}
{{#if alert}}
<div class="settings-alert"><i class="icon-attention"></i>{{{_ alert}}}</div>
{{/if}}
10 years ago
</div>
</div>
{{/each}}
{{#if section}}
10 years ago
{{#if sectionIsCustomOAuth section}}
<div class="submit">
<button class="button delete remove-custom-oauth"><span>{{_ "Remove_custom_oauth"}}</span></button>
</div>
{{/if}}
{{/if}}
{{#if hasChanges section}}
<div class="submit">
<button class="button save"><i class="icon-send"></i><span>{{_ "Save_changes"}}</span></button>
</div>
{{/if}}
</div>
</div>
{{/each}}
11 years ago
<div class="submit">
10 years ago
{{#if $eq group._id 'OAuth'}}
<button class="button secondary add-custom-oauth"><span>{{_ "Add_custom_oauth"}}</span></button>
{{/if}}
10 years ago
{{#if $eq group._id 'Assets'}}
<button class="button refresh-clients"><span>{{_ "Apply_and_refresh_all_clients"}}</span></button>
{{/if}}
11 years ago
</div>
11 years ago
</div>
{{/unless}}
</div>
</section>
</template>