1
0
mirror of https://github.com/altlinux/admc.git synced 2025-01-06 21:18:15 +03:00

Add GUID getters to AdConfig class

This commit is contained in:
Semyon Knyazev 2024-09-19 02:13:54 +04:00
parent 5dcb3f884f
commit bd6a5f15db
2 changed files with 12 additions and 0 deletions

View File

@ -559,6 +559,11 @@ QString AdConfig::guid_to_attribute(const QByteArray &guid) const {
return out;
}
QByteArray AdConfig::attribute_to_guid(const QString &attr) const {
const QByteArray attr_guid = d->guid_to_attribute_map.key(attr, QByteArray());
return attr_guid;
}
QString AdConfig::guid_to_class(const QByteArray &guid) const {
const QString out = d->guid_to_class_map.value(guid, "<unknown class>");
return out;
@ -597,6 +602,10 @@ QStringList AdConfig::get_permissionable_attributes(const QString &obj_class) co
return d->class_permissionable_attributes_map[obj_class];
}
QByteArray AdConfig::guid_from_class(const ObjectClass &object_class) {
return d->guid_to_class_map.key(object_class, QByteArray());
}
void AdConfig::load_extended_rights(AdInterface &ad)
{
const QString filter = filter_CONDITION(Condition_Equals, ATTRIBUTE_OBJECT_CLASS, CLASS_CONTROL_ACCESS_RIGHT);

View File

@ -105,6 +105,7 @@ public:
QList<QString> get_extended_rights_list(const QList<QString> &class_list) const;
QString guid_to_attribute(const QByteArray &guid) const;
QByteArray attribute_to_guid(const QString &attr) const;
QString guid_to_class(const QByteArray &guid) const;
@ -115,6 +116,8 @@ public:
QStringList get_possible_inferiors(const QString &obj_class) const;
QStringList get_permissionable_attributes(const QString &obj_class) const;
QByteArray guid_from_class(const ObjectClass &object_class);
private:
void load_extended_rights(AdInterface &ad);
void load_attribute_schemas(AdInterface &ad);