use of org.jkiss.dbeaver.model.DBPDataSourcePermission in project dbeaver by serge-rider.
the class DataSourceSerializerModern method serializeModifyPermissions.
private void serializeModifyPermissions(@NotNull JsonWriter json, DBPDataSourcePermissionOwner permissionOwner) throws IOException {
List<DBPDataSourcePermission> permissions = permissionOwner.getModifyPermission();
if (!CommonUtils.isEmpty(permissions)) {
json.name("security");
json.beginObject();
List<String> permIds = new ArrayList<>(permissions.size());
for (DBPDataSourcePermission perm : permissions) permIds.add(perm.getId());
JSONUtils.serializeStringList(json, "permission-restrictions", permIds);
json.endObject();
}
}
use of org.jkiss.dbeaver.model.DBPDataSourcePermission in project dbeaver by serge-rider.
the class EditConnectionPermissionsDialog method okPressed.
@Override
protected void okPressed() {
List<DBPDataSourcePermission> restrictions = new ArrayList<>();
for (Button permButton : restrictedPermissionButtons) {
if (permButton.getSelection()) {
restrictions.add((DBPDataSourcePermission) permButton.getData());
}
}
accessRestrictions = restrictions;
super.okPressed();
}
use of org.jkiss.dbeaver.model.DBPDataSourcePermission in project dbeaver by dbeaver.
the class EditConnectionPermissionsDialog method okPressed.
@Override
protected void okPressed() {
List<DBPDataSourcePermission> restrictions = new ArrayList<>();
for (Button permButton : restrictedPermissionButtons) {
if (permButton.getSelection()) {
restrictions.add((DBPDataSourcePermission) permButton.getData());
}
}
accessRestrictions = restrictions;
super.okPressed();
}
use of org.jkiss.dbeaver.model.DBPDataSourcePermission in project dbeaver by dbeaver.
the class EditConnectionPermissionsDialog method createDialogArea.
@Override
protected Composite createDialogArea(Composite parent) {
Composite composite = super.createDialogArea(parent);
for (DBPDataSourcePermission permission : DBPDataSourcePermission.values()) {
Button permButton = UIUtils.createCheckbox(composite, permission.getLabel(), permission.getDescription(), accessRestrictions.contains(permission), 1);
permButton.setData(permission);
permButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
restrictedPermissionButtons.add(permButton);
}
return composite;
}
use of org.jkiss.dbeaver.model.DBPDataSourcePermission in project dbeaver by serge-rider.
the class EditConnectionPermissionsDialog method createDialogArea.
@Override
protected Composite createDialogArea(Composite parent) {
Composite composite = super.createDialogArea(parent);
for (DBPDataSourcePermission permission : DBPDataSourcePermission.values()) {
Button permButton = UIUtils.createCheckbox(composite, permission.getLabel(), permission.getDescription(), accessRestrictions.contains(permission), 1);
permButton.setData(permission);
permButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
restrictedPermissionButtons.add(permButton);
}
return composite;
}
Aggregations