LogoLogo
  • Welcome to Akinon Documentation
  • Products
    • ACC
    • Omnitron
    • Commerce
    • Order Management System (OMS)
    • Instore
    • Integrator
    • Marketplace Dashboard (MPD)
    • Project Zero (PZ)
    • Seller Center
    • Akifast
    • App Maker
  • API Reference
    • Welcome to Akinon API Reference
  • Omnitron
    • Getting Started
    • Integration
      • Product
        • Product
        • Pre-Product
        • Attribute
        • Attribute Value
        • Attribute Set
        • Product Image
      • Price
        • Price List
        • Product Price
        • Currency Unit Table
      • Stock
        • Stock List
        • Product Stock
      • Order
        • Get Orders
        • Search Order
        • Get Order Detail by Order Number
        • Get Order Item Detail
        • Orders ID Detail Integration
        • Orders Waiting to Send to ERP
        • Update Order and Order Item
        • Stock Reservation Release
        • Order Cancellation
        • Cancellation & Refund Pending Orders
        • Order Discount Items
        • Order Status Codes & Cancellation Statuses
      • Migration
        • Getting Started
        • User Migration
        • Address Migration
        • Old Order Migration
        • Old Order Item Migration
        • View Migration Progress
        • Currency Options
    • PIM
      • Attributes & Sets
      • Mapping
      • Localization
      • Media
    • Catalogue
      • Introduction
      • Price List
      • Stock List
      • Catalogue Item
      • Category Trees
      • Product Collection
      • Product Sorting
    • Channels
      • Introduction
      • Payments
      • Customers
    • Order
      • Getting Started
      • Fulfillment
      • Cancellations & Refunds
    • Retail Stores
      • Retail Stores
    • User Management
      • Roles & Permissions
      • Add & Remove
    • Whippy Ware
      • Introduction
      • Stock
      • Stock Lists
      • Stock List Rules
      • Stock Providers
      • Stock Locations
  • Omnitron OpenAPIs
    • Without Server
      • Customers
      • Reporting
      • Deleted Items
      • Pos
      • AttributeValues
      • Attribute Values
      • Providers
      • LDAPProviders
      • Healthcheck
      • LoyaltyTransactions
      • Policies
      • Exports
      • Dashboard
      • AuthTOTP
      • Price Lists
      • ProductPrices
      • Districts
      • Cities
      • Countries
      • Townships
      • PrometheusMetrics
      • Language
      • Content Types
      • Mappings
      • Applications
      • ApplicationPermissions
      • Error Reports
      • MailTemplates
      • UploadLogo
      • SalesChannelMarketPlaceAttributeSetConfig
      • SalesChannelCancellationRequestImage
      • SalesChannelCities
      • SalesChannelCancellationReasons
      • SalesChannelCargoCompany
      • SalesChannelProductImage
      • SalesChannelAttributeConfig
      • SalesChannelAttributeValueConfig
      • SalesChannelTownships
      • SalesChannelCustomers
      • SalesChannelFailedIntegrations
      • SalesChannelGetStockList
      • SalesChannelRetailStore
      • IntegrationActions
      • SalesChannelOrderShippingInfo
      • SalesChannelBatchRequests
      • SalesChannelAddresses
      • SalesChannelMarketPlaceAttributeSet
      • SalesChannelErrorReports
      • SalesChannelCategoryNodes
      • SalesChannelDistricts
      • SalesChannelProductStock
      • SalesChannelExtraProductStock
      • SalesChannelOrders
      • SalesChannelCancellationPlans
      • SalesChannelExtraProductPrices
      • SalesChannelProduct
      • SalesChannelAttributeSchemas
      • SalesChannelProductCategories
      • SalesChannelCancellationRequests
      • SalesChannelMarketPlaceAttributeValue
      • SalesChannelMappedProduct
      • SalesChannelMarketPlaceAttribute
      • SalesChannelOrderItem
      • SalesChannelProductPrice
      • SalesChannelCreateOrder
      • GetPriceList
      • SalesChannelCountries
      • SalesChannelGetPriceList
      • SalesChannelCategoryTree
    • With Server
      • Customers
      • Reporting
      • Deleted Items
      • Pos
      • AttributeValues
      • Attribute Values
      • Providers
      • LDAPProviders
      • Healthcheck
      • LoyaltyTransactions
      • Policies
      • Exports
      • Dashboard
      • AuthTOTP
      • Price Lists
      • ProductPrices
      • Districts
      • Cities
      • Countries
      • Townships
      • PrometheusMetrics
      • Language
      • Mappings
      • Content Types
      • Applications
      • ApplicationPermissions
      • Error Reports
      • MailTemplates
      • UploadLogo
      • SalesChannelMarketPlaceAttributeSetConfig
      • SalesChannelCancellationRequestImage
      • SalesChannelCities
      • SalesChannelCancellationReasons
      • SalesChannelCargoCompany
      • SalesChannelProductImage
      • SalesChannelAttributeConfig
      • SalesChannelAttributeValueConfig
      • SalesChannelTownships
      • SalesChannelCustomers
      • SalesChannelFailedIntegrations
      • SalesChannelGetStockList
      • IntegrationActions
      • SalesChannelRetailStore
      • SalesChannelOrderShippingInfo
      • SalesChannelBatchRequests
      • SalesChannelAddresses
      • SalesChannelMarketPlaceAttributeSet
      • SalesChannelErrorReports
      • SalesChannelDistricts
      • SalesChannelCategoryNodes
      • SalesChannelProductStock
      • SalesChannelExtraProductStock
      • SalesChannelCountries
      • SalesChannelOrders
      • SalesChannelProduct
      • SalesChannelCancellationPlans
      • SalesChannelExtraProductPrices
      • SalesChannelProductCategories
      • SalesChannelAttributeSchemas
      • SalesChannelCancellationRequests
      • SalesChannelMarketPlaceAttributeValue
      • SalesChannelMappedProduct
      • SalesChannelMarketPlaceAttribute
      • SalesChannelOrderItem
      • SalesChannelProductPrice
      • SalesChannelCreateOrder
      • GetPriceList
      • SalesChannelGetPriceList
      • SalesChannelCategoryTree
  • Commerce
    • Users
      • Getting Started
      • User Management & Authentication
      • Password & OTP Operations
      • User Profile & Segment Management
      • User Payment & Card Management
      • User Orders & Cancellations
      • Anonymous User Orders & Cancellations
      • User Support & Conversation
      • Captcha Validation
      • Currency & Akifast Operations
    • Checkout
      • Payment Related
      • Payment Strategy Related
      • Shipping Related
      • Independent Pages
    • Product
    • User Collections
    • Basket
    • Discount
    • Autocomplete
    • Breadcrumb
    • Pretty URLs
    • Menu
    • Widgets
    • Loyalty Accounts
    • Address Migration
    • Index Configuration
    • Favourite Products
    • User Address
    • Data Warehouse
    • Introduction
      • Filtering Parameters
    • Data Warehouse
    • Default
  • OMS
    • Package Services
    • Package Item Services
    • Package Denial Reason Services
    • Order Services
    • Order Item Services
    • Transfer Order Services
    • Transfer Item Services
    • Channel Services
    • Cancellation Plan Services
    • Cancellation Reason Services
    • Address Setup Services
    • City Services
    • District Services
    • Township Services
    • Stock Location Address Services
    • Webhook Setup Services
    • Webhook Event Services
    • Omnitron Order Webhooks
    • Undelivered Webhook Event Services
    • Inventory Discrepancy Services
    • OMS Setup Services
    • UI Settings Services
    • OMS Audit Events Service
    • Customer Address Services
    • Application Settings Services
    • Content Type Services
    • Customer Services
    • Channel Setup Services
    • Demo Data Service
    • Order Execution Plan Services
    • Invoice Services
    • Localization Services
    • Action Log Services
    • Order Log Services
    • Celery Metrics Service
    • Stock Location Services
    • Stock Location Address Services
    • Stock Location Sender Address Services
    • Stock Location Sender Address Setup Services
    • Cargo Company Condition Services
    • Permission Group Services
  • Instore
    • Password Reset Services
  • Integrator
    • Projects
    • Flows
    • Logs
  • Seller Center
    • Languages
    • Categories
    • Introduction
    • Products
    • Packages
    • Orders
    • Claims
    • Shipping Methods
  • Akifast
    • Authentication
  • B2B
    • Quotation
    • Basket
    • Division
    • User
    • Staff User
    • Groups
    • Notification
    • Notification Template
  • Flows
    • Shipment Flows
    • Payment Flows
    • SMS Flows
    • Basket Offer Flows
Powered by GitBook

© 2025 Akinon. All rights reserved.

On this page
  • User App
  • User Screens
  • GET All Users
  • POST Create a New User
  • GET User Detail
  • PATCH Update User
  • PUT Update User
  • DELETE User
  • Other Viewsets and Endpoints
  • ActiveUserViewSet
  • GET Active User
  • PUT Update Active User
  • PATCH Partially Update Active User
  • PUT Change Active User’s Password
  • BEPermissionNamespaceViewSet
  • GET User Permission Scope
  • GET Detailed User Permission Scope
  • PATCH Assign Users to a User Permission Scope
  • PATCH Remove Users from a User Permission Scope
  • BEPermissionViewSet
  • GET User Permissions
  • GET Detailed User Permission
  • PATCH Assign Users to a User Permission
  • PATCH Remove Users from a User Permission
  • GroupViewSet
  • GET User Permission Groups
  • POST Create a New Permission Group
  • PATCH-PUT Update a Permission Group
  • DELETE Delete a Permission Group
  • CatalogGroupViewSet
  • GET Catalog Groups
  • POST Add Group to a Catalog
  • DELETE Delete a Catalog Group
  • ChannelGroupViewSet
  • GET Channel Groups
  • POST Add Group to a Channel
  • DELETE Delete a Catalog Group
  • FEPermissionGroupViewSet
  • POST Create a Permission Group for Omnitron Frontend
  • GET Retrieve Omnitron Frontend Permission Groups
  • GET Omnitron Frontend Permission Group
  • PATCH Add a New User to Omnitron Frontend Permission Group
  • PATCH Remove Users from an Omnitron Frontend Permission Group
  • PATCH Add an Omnitron Frontend Permission to Omnitron Frontend Permission Group
  • PATCH Remove an Omnitron Frontend Permission from an Omnitron Frontend Permission Group
  • FEPermissionViewSet
  • GET Omnitron Frontend Permissions
  • GET Omnitron Frontend Permission
  • PATCH Assign Users to an Omnitron Frontend Permission
  • PATCH Remove Users from a User Permission
  • PATCH Assign Omnitron Frontend Permission Groups to an Omnitron Frontend Permission
  • PATCH Remove Users from a User Permission

Was this helpful?

  1. Omnitron
  2. User Management

Add & Remove

User App

Django web framework features a very useful user identification and permission infrastructure. In this context, it includes Users for user identification, Permissions for assigning users the permission to undertake certain jobs, and Groups for grouping the permission(s) to be assigned to multiple users.

In Omnitron, this infrastructure provided by Django has been inherited and expanded, and the “Users” application has been developed for all user operations: from creating users to defining roles and permissions for users. The application contains the models listed below.

  • UserProfile -> The model for defining users.

  • BEPermissionNamespace -> The namespace model for backend user permissions.

  • BEPermission -> The model for defining backend permissions.

  • FEPermissionGroup -> The model for defining the general permission groups of users.

  • FEPermission -> The model for defining frontend permissions.

  • CatalogGroup -> The model for defining the permission groups of users on the catalog(s).

  • ChannelGroup -> The model for defining the permission groups of users on the channel(s).

Storing user information, UserProfile is used by expanding on the User and AbstractUser classes of Django. The AbstractUser model inherits from the PermissionMixin and AbstractBaseUser models. PermissionMixin permits the defining of user-specific permissions with the user_permission field. In addition, the User’s current status can be defined by fields such as is_active, is_superuser, and is_staff. These are the features that Django offers as part of user management.

User Screens

User information can be accessed, new users can be added and the properties of existing users can be changed from Settings> Users on Omnitron V2.

In the general permission groups section, permission groups can be defined for existing users. Outside of general permission groups, the user access permission breakdown can also be increased with catalog permission groups (permissions for access to the catalogs application) and channel permission groups (permission for access to the channels application). ViewSet Users application includes UserViewSet, ActiveUserViewSet, BEPermissionViewSet, FEPermissionViewSet, FEPermissionGroupViewSet, BEPermissionNamespaceViewSet, GroupViewSet, CatalogGroupViewSet, and ChannelGroupViewSet. Below are the endpoints of these viewsets and sample request-response information for some of them.

UserViewSet

Endpoints

/api/v1/users/

{"/api/v1/users/{pk}/"}

GET All Users

Path: /api/v1/users/

Returns all objects in the User table paged.

Response

{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"pk": 1,
"username": "foo",
"first_name": "bar",
"last_name": "baz",
"email": "qux@akinon.com",
"is_staff": true,
"is_active": true,
"date_joined": "2022-12-21T10:32:51.707174Z",
"last_login": "2022-12-21T12:21:30.684071Z",
"is_superuser": true,
"groups": [1, 2, 3]
},
…
]
}

POST Create a New User

Path: /api/v1/users/

Records new objects in the User table. Uses the UserSerializer class defined at omnitron.users.resources.serializers for data verification.

Field

Type

Mandatory

Default

username

string

Yes

N/A

password

string*

Yes

N/A

email

string

Yes

N/A

groups

list(integer)

Yes

N/A

first_name

string

No

None

last_name

string

No

None

is_active

boolean

No

True

is_staff

boolean

No

False

is_superuser

boolean

No

False

Note: Password is required to have at least eight characters, including a capital letter, a number, and a special character.

{
  "username": "foo",
  "password": "Bar123*!",
  "email": "baz@akinon.com",
  "groups": [1, 2, 3]
}

Response

{
  "pk": 2,
  "username": "foo",
  "first_name": "",
  "last_name": "",
  "email": "baz@akinon.com",
  "is_staff": false,
  "is_active": true,
  "date_joined": "2022-12-21T09:15:38.123104Z",
  "last_login": null,
  "is_superuser": false,
  "groups": [1, 2, 3]
}

GET User Detail

Path: /api/v1/users/{pk}/

Returns the object specified with the primary key in the User table by serializing it with the UserSerializer class defined at omnitron.users.resources.serializers.

Response

{
  "pk": 1,
  "username": "foo",
  "first_name": "bar",
  "last_name": "baz",
  "email": "qux@akinon.com",
  "is_staff": true,
  "is_active": true,
  "date_joined": "2022-12-21T10:32:51.707174Z",
  "last_login": "2022-12-21T12:21:30.684071Z",
  "is_superuser": true,
  "groups": [1, 2, 3]
}

PATCH Update User

Path: /api/v1/users/{pk}/

Updates the object of the relevant primary key in the User table. Updates the provided parameters.

Field

Type

Mandatory

Default

username

string

No

N/A

password

string*

No

N/A

email

string

No

N/A

groups

list(integer)

No

N/A

first_name

string

No

None

last_name

string

No

None

is_active

boolean

No

true

is_staff

boolean

No

false

is_superuser

boolean

No

false

Note: password is required to have at least eight characters, including a capital letter, a number, and a special character.

{
   "first_name": "Very Very New"
}

Response / 200 Serialized version of the object. Example response of the POST method can be observed.

Response / 400 When a request is made with an incorrect PK, the following response is returned. Here, the HTTP code in the response to the HTTP request will be 404.

{
   "detail": "Not found."
}

PUT Update User

Path: /api/v1/users/{pk}/

Updates the object of the relevant primary key in the User table. Updates all fields of the object. All required fields in the body of this method must be sent. The POST method can be examined for the fields that can be sent.

{
  "username": "foo",
  "first_name": "qux",
  "password": "Bar123*!",
  "email": "baz@akinon.com",
  "groups": [1, 2, 3]
}

Response / 200 Serialized version of the object. Sample response of the POST method can be observed.

Response / 400 When a request is made with an incorrect PK, the following response is returned. Here, the HTTP code in the response to the HTTP request will be 404.

{
   "detail": "Not found."
}

DELETE User

Path: /api/v1/users/{pk}/

Permits the removal of the object specified by the primary key from the User table.

Response

Response / 204 When a deletion request is completed.

Response / 400 When a request is made with an incorrect PK, the following response is returned. Here, the HTTP code in the response to the HTTP request will be 404.

{
   "detail": "Not found."
}

Other Viewsets and Endpoints

ActiveUserViewSet

This ViewSet always uses the current user which is determined by the request as a resource.

Endpoints

/api/v1/active_user/

/api/v1/active_user/change_password/

GET Active User

Path: /api/v1/active_user/

Returns current user object as paged response.

Response


{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"pk": 1,
"username": "foo",
"first_name": "bar",
"last_name": "baz",
"email": "qux@akinon.com",
"is_staff": true,
"is_active": true,
"date_joined": "2022-12-21T10:32:51.707174Z",
"last_login": "2022-12-21T12:21:30.684071Z",
"is_superuser": true,
"groups": [1, 2, 3]
},
…
]
}

PUT Update Active User

Path: /api/v1/active_user/

Updates current user in the User table. Uses the ActiveUserSerializer class defined at omnitron.users.resources.serializers for data verification.

Field

Type

Mandatory

Default

username

string

Yes

N/A

email

string

No

N/A

first_name

string

No

N/A

last_name

string

No

N/A

userprofile

{`Dict{ Avatar, Phone Number }`}

Yes

N/A

{
  "username": "admin",
  "first_name": "foo",
  "last_name": "bar",
  "email": "qux@akinon.com",
  "userprofile": {
    "avatar": "{FILE}",
    "phone_number": "+901231231212"
  }
}

Response

{
  "pk": 1,
  "username": "admin",
  "first_name": "foo",
  "last_name": "bar",
  "email": "qux@akinon.com",
  "date_joined": "2022-12-15T10:32:51.707174Z",
  "last_login": "2022-12-22T09:27:26.361642Z",
  "groups": [{ "pk": 1, "name": "Sample Group" }],
  "userprofile": {
    "pk": 1,
    "avatar": null,
    "phone_number": "+901231231212"
  }
}

PATCH Partially Update Active User

Path: /api/v1/active_user/

Partially updates current user in the User table. Uses the ActiveUserSerializer class defined at omnitron.users.resources.serializers for data verification.

Field

Type

Mandatory

Default

username

string

No

N/A

email

string

No

N/A

first_name

string

No

N/A

last_name

string

No

N/A

userprofile

{`Dict{ Avatar, Phone Number }`}

No

N/A

{
    "first_name": "fred",
    "userprofile": {
        "phone_number": "+900000000"
    }
}

Response

{
  "pk": 1,
  "username": "admin",
  "first_name": "fred",
  "last_name": "bar",
  "email": "qux@akinon.com",
  "date_joined": "2022-12-15T10:32:51.707174Z",
  "last_login": "2022-12-22T09:27:26.361642Z",
  "groups": [],
  "userprofile": {
    "pk": 1,
    "avatar": null,
    "phone_number": "+900000000"
  }
}

PUT Change Active User’s Password

Path: /api/v1/active_user/change_password/

Updates current user in the User table. Uses the ChangePasswordSerializer class defined at omnitron.users.resources.serializers for data verification.

{
    "old_password": "{CURRENT PASSWORD}",
    "new_password": "{NEW PASSWORD}"
}

The new password is required to have at least eight characters, including a capital letter, a number, and a special character. Also, it must be different from the last two passwords used. There will be a 400 Bad Request response if the given new password does not match the specified criteria.

Response

{
  "old_password": "{CURRENT PASSWORD}",
  "new_password": "{NEW PASSWORD}"
}

BEPermissionNamespaceViewSet

Endpoints

/api/v1/be_permission_namespace/

{`/api/v1/be_permission_namespace/{PK}/`}

{`/api/v1/be_permission_namespace/{PK}/assign-users/`}

{`/api/v1/be_permission_namespace/{PK}/remove-users/`}

GET User Permission Scope

Path: /api/v1/be_permission_namespace/

Returns by serializing all records in the BEPermissionNamespace table with the BEPermissionNamespaceSerializer class defined at omnitron.users.resources.serializers.

Response

{
  "count": 19,
  "next": "{OMNITRON}/api/v1/be_permission_namespace/?page=2",
  "previous": null,
  "results": [
    {
      "pk": 1,
      "name": "products",
      "users": [],
      "modified_date": "2021-08-25T09:22:54.538000Z",
      "created_date": "2021-08-25T09:22:54.538000Z"
    },
    {
      "pk": 2,
      "name": "catalogs",
      "users": [],
      "modified_date": "2021-08-25T09:22:54.750000Z",
      "created_date": "2021-08-25T09:22:54.750000Z"
    },
    {
      "pk": 3,
      "name": "customers",
      "users": [],
      "modified_date": "2021-08-25T09:22:55.260000Z",
      "created_date": "2021-08-25T09:22:55.260000Z"
    },
    {
      "pk": 4,
      "name": "address",
      "users": [],
      "modified_date": "2021-08-25T09:22:55.290000Z",
      "created_date": "2021-08-25T09:22:55.290000Z"
    },
    {
      "pk": 5,
      "name": "orders",
      "users": [],
      "modified_date": "2021-08-25T09:22:55.573000Z",
      "created_date": "2021-08-25T09:22:55.573000Z"
    },
    {
      "pk": 6,
      "name": "channels",
      "users": [],
      "modified_date": "2021-08-25T09:22:56.209000Z",
      "created_date": "2021-08-25T09:22:56.209000Z"
    },
    {
      "pk": 7,
      "name": "errors",
      "users": [],
      "modified_date": "2021-08-25T09:22:56.260000Z",
      "created_date": "2021-08-25T09:22:56.260000Z"
    },
    {
      "pk": 8,
      "name": "api",
      "users": [],
      "modified_date": "2021-08-25T09:22:56.297000Z",
      "created_date": "2021-08-25T09:22:56.297000Z"
    },
    {
      "pk": 9,
      "name": "users",
      "users": [],
      "modified_date": "2021-08-25T09:22:56.332000Z",
      "created_date": "2021-08-25T09:22:56.332000Z"
    }
  ]
}

GET Detailed User Permission Scope

Path: /api/v1/be_permission_namespace/{PK}

Returns by serializing requested records matching the given PK in the BEPermissionNamespace table with the BEPermissionNamespaceSerializer class defined at omnitron.users.resources.serializers.

Response

{
  "pk": 1,
  "name": "products",
  "users": [],
  "modified_date": "2021-08-25T09:22:54.538000Z",
  "created_date": "2021-08-25T09:22:54.538000Z"
}

PATCH Assign Users to a User Permission Scope

Path: /api/v1/be_permission_namespace/{PK}/assign-users/

Assigns given users to the record matching the given PK in the BEPermissionNamespace table.

{
    "users": [1, 2, ...]
}

Response

{
  "pk": 1,
  "name": "products",
  "users": [1, 2],
  "modified_date": "2021-08-25T09:22:54.538000Z",
  "created_date": "2021-08-25T09:22:54.538000Z"
}

PATCH Remove Users from a User Permission Scope

Path: /api/v1/be_permission_namespace/{PK}/remove-users/

Removes given users from the record matching the given PK in the BEPermissionNamespace table.

{
    "users": [1, 2, ...]
}

Response

{
  "pk": 1,
  "name": "products",
  "users": [],
  "modified_date": "2021-08-25T09:22:54.538000Z",
  "created_date": "2021-08-25T09:22:54.538000Z"
}

BEPermissionViewSet

Endpoints

/api/v1/be_permissions/

{`/api/v1/be_permissions/{PK}/`}

{`/api/v1/be_permissions/{PK}/assign-users/`}

{`/api/v1/be_permissions/{PK}/remove-users/`}

GET User Permissions

Path: /api/v1/be_permissions/

Returns by serializing all records in the BEPermissions table with the BEPermissionSerializer class defined at omnitron.users.resources.serializers.

Response

{
    "count": 2057,
    "next": "{OMNITRON}/api/v1/be_permissions/?limit=1&page=2",
    "previous": null,
    "results": [
        {
            "pk": 1,
            "name": "products-post-api/v1/products/$",
            "namespace": 1,
            "action": "post",
            "path": "api/v1/products/$",
            "users": [],
            "modified_date": "2021-08-25T09:22:54.540000Z",
            "created_date": "2021-08-25T09:22:54.540000Z"
        }
    ],
    …
}

GET Detailed User Permission

Path: /api/v1/be_permissions/{PK}/

Returns by serializing requested records matching the given PK in the BEPermission table with the BEPermissionSerializer class defined at omnitron.users.resources.serializers.

Response

{
  "pk": 1,
  "name": "products-post-api/v1/products/$",
  "namespace": 1,
  "action": "post",
  "path": "api/v1/products/$",
  "users": [],
  "modified_date": "2021-08-25T09:22:54.540000Z",
  "created_date": "2021-08-25T09:22:54.540000Z"
}

PATCH Assign Users to a User Permission

Path: /api/v1/be_permission/{PK}/assign-users/

Assigns given users to the record matching the given PK in the BEPermission table.

{
    "users": [1, 2, ...]
}

Response

{
  "pk": 1,
  "name": "products-post-api/v1/products/$",
  "namespace": 1,
  "action": "post",
  "path": "api/v1/products/$",
  "users": [1, 2],
  "modified_date": "2021-08-25T09:22:54.540000Z",
  "created_date": "2021-08-25T09:22:54.540000Z"
}

PATCH Remove Users from a User Permission

Path: /api/v1/be_permission/{PK}/remove-users/

Removes given users from the record matching the given PK in the BEPermission table.

{
    "users": [1, 2, ...]
}

Response

{
  "pk": 1,
  "name": "products-post-api/v1/products/$",
  "namespace": 1,
  "action": "post",
  "path": "api/v1/products/$",
  "users": [],
  "modified_date": "2021-08-25T09:22:54.540000Z",
  "created_date": "2021-08-25T09:22:54.540000Z"
}

GroupViewSet

Endpoints

/api/v1/groups/

{`/api/v1/groups/{PK}/`}

GET User Permission Groups

Path: /api/v1/groups/

Retrieves records from the Group table in the django.contrib.auth.models module that comes with Django. User permission groups are saved in this table. The Group table is defined as Foreign Key in the CatalogGroup and ChannelGroup tables on Omnitron.

Response

{
  "count": 2,
  "next": null,
  "previous": null,
  "results": [
    {
      "pk": 1,
      "name": "Shop Catalog Group"
    },
    {
      "pk": 2,
      "name": "Shop Channel Group"
    }
  ]
}

POST Create a New Permission Group

Path: /api/v1/groups/

Adds a record to the Group table in the django.contrib.auth.models module included with Django.

{
  "name": "test group"
}

Response

{
  "pk": 3,
  "name": "test group"
}

PATCH-PUT Update a Permission Group

Path: /api/v1/groups/{PK}/

Updates the record that matches the given PK value in the Group table in the django.contrib.auth.models module included with Django.

{
  "name": "new name"
}

Response

{
  "pk": 3,
  "name": "new name"
}

DELETE Delete a Permission Group

Path: /api/v1/groups/{PK}/

Deletes the record that matches the given PK value in the Group table in the django.contrib.auth.models module included with Django.

Response

Response / 204 When a deletion request is completed.

CatalogGroupViewSet

Endpoints

/api/v1/catalog_groups/

{`/api/v1/catalog_groups/{PK}/`}

GET Catalog Groups

Path: /api/v1/catalog_groups/

Returns the details of all records in the CatalogGroup table via serializing with the CatalogGroupSerializer class defined at omnitron.users.resources.serializers.

Successful Response Example

{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "pk": 1,
      "group": 1,
      "catalogs": [],
      "modified_date": "2022-12-15T10:30:59.143621Z",
      "created_date": "2022-12-15T10:30:59.143602Z"
    }
  ]
}

POST Add Group to a Catalog

Path: /api/v1/catalog_groups/

Allows adding new records to the CatalogGroup table. Returns by serializing with the CatalogGroupSerializer class defined at omnitron.users.resources.serializers.

{
  "group": 2,
  "catalogs": [1]
}

Response

{
  "pk": 2,
  "group": 2,
  "catalogs": [1],
  "modified_date": "2022-12-23T08:58:24.423329Z",
  "created_date": "2022-12-23T08:58:24.423309Z"
}

DELETE Delete a Catalog Group

Path: /api/v1/catalog_groups/

Deletes the record that matches the given PK value in the CatalogGroup table.

Response

Response / 204 When a deletion request is completed.

ChannelGroupViewSet

Endpoints

/api/v1/channel_groups/

{`/api/v1/channel_groups/{PK}/`}

GET Channel Groups

Path: /api/v1/channel_groups/

Returns the details of all records in the ChannelGroup table via serializing with the ChannelGroupSerializer class defined at omnitron.users.resources.serializers.

Response

{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "pk": 1,
      "group": 2,
      "channels": [],
      "modified_date": "2022-12-15T10:30:59.145952Z",
      "created_date": "2022-12-15T10:30:59.145937Z"
    }
  ]
}

POST Add Group to a Channel

Path: /api/v1/channel_groups/

Allows adding new records to the ChannelGroup table. Returns by serializing with the ChannelGroupSerializer class defined at omnitron.users.resources.serializers.

{
  "group": 1,
  "channels": [1]
}

Response

{
  "pk": 2,
  "group": 1,
  "channels": [1],
  "modified_date": "2022-12-23T09:16:37.793249Z",
  "created_date": "2022-12-23T09:16:37.793228Z"
}

DELETE Delete a Catalog Group

Path: /api/v1/channel_groups/

Deletes the record that matches the given PK value in the ChannelGroup table.

Response

Response / 204 When a deletion request is completed.

FEPermissionGroupViewSet

Endpoints

/api/v1/fe_permission_groups/

{`/api/v1/fe_permission_groups/{PK}/`}

{`/api/v1/fe_permission_groups/{PK}/assign-permissions/`}

{`/api/v1/fe_permission_groups/{PK}/assign-users/`}

{`/api/v1/fe_permission_groups/{PK}/remove-permissions/`}

{`/api/v1/fe_permission_groups/{PK}/remove-users/`}

POST Create a Permission Group for Omnitron Frontend

Path: /api/v1/fe_permission_groups/

Adds records to the FEPermissionGroup table by serializing with the FEPermissionGroupSerializer class defined at omnitron.users.resources.serializers.

{
  "name": "Test",
  "description": null,
  "users": [],
  "fepermissions": []
}

Response

{
  "pk": 1,
  "name": "Test",
  "description": null,
  "users": [],
  "fepermissions": [],
  "modified_date": "2022-12-23T09:19:51.140162Z",
  "created_date": "2022-12-23T09:19:51.132038Z"
}

GET Retrieve Omnitron Frontend Permission Groups

Path: /api/v1/fe_permission_groups/

Returns the details of all records in the FEPermissionGroup table via serializing with the FEPermissionGroupSerializer class defined at omnitron.users.resources.serializers.

Response

{
  "count": 2,
  "next": null,
  "previous": null,
  "results": [
    {
      "pk": 1,
      "name": "Test",
      "description": null,
      "users": [],
      "fepermissions": [],
      "modified_date": "2022-12-23T09:19:51.140162Z",
      "created_date": "2022-12-23T09:19:51.132038Z"
    },
    {
      "pk": 2,
      "name": "Test 1",
      "description": null,
      "users": [],
      "fepermissions": [],
      "modified_date": "2022-12-23T09:22:08.105610Z",
      "created_date": "2022-12-23T09:22:08.104905Z"
    }
  ]
}

GET Omnitron Frontend Permission Group

Path: /api/v1/fe_permission_groups/{PK}

Returns the details of the record that matches the given PK in the FEPermissionGroup table via serializing with the FEPermissionGroupSerializer class defined at omnitron.users.resources.serializers.

Response

{
  "pk": 1,
  "name": "Test",
  "description": null,
  "users": [],
  "fepermissions": [],
  "modified_date": "2022-12-23T09:19:51.140162Z",
  "created_date": "2022-12-23T09:19:51.132038Z"
}

PATCH Add a New User to Omnitron Frontend Permission Group

Path: /api/v1/fe_permission_groups/{PK}/assign-users/

Permits the addition of users to a record in the FEPermissionGroup table.

{
  "users": [1, 2, …]
}

Response

{
  "pk": 1,
  "users": [8, 9]
}

PATCH Remove Users from an Omnitron Frontend Permission Group

Path: /api/v1/fe_permission_groups/{PK}/remove-users/

Permits the removal of users to a record in the FEPermissionGroup table.

{
  "users": [1, 2, …]
}

Response

{
   "pk": 1,
   "users": [
       8,
       9,
       1,
       2,
       …
   ]
}

Following the remove-users request, the relevant record is observed as follows.

{
   "pk": 1,
   "name": "Test",
   "description": null,
   "users": [
       8,
       9
   ],
   "fepermissions": []
   "modified_date": "2022-12-23T09:19:51.140162Z",
   "created_date": "2022-12-23T09:19:51.132038Z"
}

PATCH Add an Omnitron Frontend Permission to Omnitron Frontend Permission Group

Path: /api/v1/fe_permission_groups/{PK}/assign-permissions/

Permits the addition of an Omnitron Frontend Permission to a record in the FEPermissionGroup table.

{
  "fepermissions": [1, 2, …]
}

Response

{
   "pk": 1,
   "fepermissions": [
       1,
       2,
       …
   ]
}

PATCH Remove an Omnitron Frontend Permission from an Omnitron Frontend Permission Group

Path: /api/v1/fe_permission_groups/{PK}/remove-permissions/

Permits the removal of users from a record in the FEPermissionGroup table.

{
  "fepermissions": [1, 2, …]
}

Response

{
  "pk": 1,
  "fepermissions": []
}

FEPermissionViewSet

Endpoints

/api/v1/fe_permissions/

{`/api/v1/fe_permissions/{PK}/`}

{`/api/v1/fe_permissions/{PK}/assign-groups/`}

{`/api/v1/fe_permissions/{PK}/assign-users/`}

{`/api/v1/fe_permissions/{PK}/remove-groups/`}

{`/api/v1/fe_permissions/{PK}/remove-users/`}

/api/v1/fe_permissions/detailed_list/

GET Omnitron Frontend Permissions

Path: /api/v1/fe_permissions/

Returns by serializing all records in the FEPermissions table with the FEPermissionSerializer class defined at omnitron.users.resources.serializers.

Response

{
    "count": 514,
    "next": "http://localhost:8000/api/v1/fe_permissions/?page=2",
    "previous": null,
    "results": [
        {
            "pk": 1,
            "name": "is_superuser",
            "slug": "is_superuser",
            "namespace_path": null,
            "path": "",
            "users": [],
            "be_permissions": [],
            "fe_permission_groups": [],
            "depth": 0,
            "modified_date": "2021-08-25T09:22:57.546000Z",
            "created_date": "2021-08-25T09:22:57.546000Z"
        }
    ],
    …
}

GET Omnitron Frontend Permission

Path: /api/v1/fe_permissions/{PK}/

Returns by serializing requested records matching the given PK in the FEPermission table with the FEPermissionSerializer class defined at omnitron.users.resources.serializers.

Response

{
  "pk": 1,
  "name": "is_superuser",
  "slug": "is_superuser",
  "namespace_path": null,
  "path": "",
  "users": [],
  "be_permissions": [],
  "fe_permission_groups": [],
  "depth": 0,
  "modified_date": "2021-08-25T09:22:57.546000Z",
  "created_date": "2021-08-25T09:22:57.546000Z"
}

PATCH Assign Users to an Omnitron Frontend Permission

Path: /api/v1/fe_permission/{PK}/assign-users/

Assigns given users to the record matching the given PK in the FEPermission table.

{
    "users": [1, 2, ...]
}

Response

{
    "pk": 1,
    "users": [
        1,
        2,
        …
    ]
}

PATCH Remove Users from a User Permission

Path: /api/v1/fe_permission/{PK}/remove-users/

Removes given users from the record matching the given PK in the FEPermission table.

{
    "users": [1, 2, ...]
}

Response

{
    "pk": 1
    "users": []
}

PATCH Assign Omnitron Frontend Permission Groups to an Omnitron Frontend Permission

Path: /api/v1/fe_permission/{PK}/assign-groups/

Assigns given FEPermissionGroups to the record matching the given PK in the FEPermission table.

{
    "fe_permission_groups": [1, 2, ...]
}

Response

{
    "pk": 1,
    "fe_permission_groups": [
        1,
        2,
        …
    ]
}

PATCH Remove Users from a User Permission

Path: /api/v1/fe_permission/{PK}/remove-groups/

Removes given FEPermissionGroups from the record matching the given PK in the FEPermission table.

{
    "fe_permission_groups": [1, 2, ...]
}

Response

{
    "pk": 1
    "fe_permission_groups": []
}
PreviousRoles & PermissionsNextWhippy Ware

Last updated 26 days ago

Was this helpful?