Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR from Develop to Design System #2175

Merged
merged 101 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
1f706d3
FWF-3381 [Feature] changed customRoles=user group
shuhaib-aot Jun 5, 2024
203efc3
FWF-3325: [Feature] Save group role mapping
auslin-aot Jun 5, 2024
90c7a35
FWF-3325: [Feature] Added tenantKey to main group
auslin-aot Jun 6, 2024
0818b48
Merge pull request #2096 from auslin-aot/feature/FWF-3325-save-group-…
arun-s-aot Jun 6, 2024
2e33097
FWF:3381 [feature] Added tenantkey filteration in groups
shuhaib-aot Jun 6, 2024
7b17388
Merge branch 'feature/FWF-3316-permission-matrix' of https://github.c…
shuhaib-aot Jun 6, 2024
96e6d63
Merge branch 'develop' of https://github.com/AOT-Technologies/forms-f…
shuhaib-aot Jun 6, 2024
82db453
FWF-3325: [Feature] group role mapping changes in roles crud
auslin-aot Jun 6, 2024
12e2d8c
Merge branch 'develop' of https://github.com/AOT-Technologies/forms-f…
auslin-aot Jun 7, 2024
c11b0da
Merge pull request #2101 from auslin-aot/sync/7-6-2024-develop-to-per…
arun-s-aot Jun 7, 2024
8d995d7
Merge branch 'feature/FWF-3316-permission-matrix' of https://github.c…
shuhaib-aot Jun 7, 2024
e380402
Merge pull request #2095 from shuhaib-aot/Feature/FWF-3381-formio-tok…
arun-s-aot Jun 7, 2024
3f3cfb9
FWF-3325: [Feature] Updated GroupService as baseclass for ClientService
auslin-aot Jun 7, 2024
b906f14
Merge pull request #2100 from auslin-aot/feature/FWF-3325-webapi-grou…
arun-s-aot Jun 10, 2024
cbe6cf4
updated relm
abilpraju-aot Jun 12, 2024
c5c1004
updated changes for manage_integretion
abilpraju-aot Jun 18, 2024
4e899a1
Update formsflow-ai-realm.json
abilpraju-aot Jun 21, 2024
e928905
Merge branch 'develop' of https://github.com/AOT-Technologies/forms-f…
shuhaib-aot Jun 25, 2024
0c4c011
FWF:3327 [feature] Created Permissions file to handle permission
shuhaib-aot Jun 25, 2024
7e081bc
FWF:3327 [feature] changed utils link
shuhaib-aot Jun 25, 2024
e0d203a
FWF:3327 [feature] fixed permissions in util folder
shuhaib-aot Jun 25, 2024
1da480f
FWF-3380: [Feature] captured tenant based groups in camunda context
auslin-aot Jun 25, 2024
273dbea
BPM changes
sumesh-aot Jun 25, 2024
195eb97
Update KeycloakAuthenticationProvider.java
sumesh-aot Jun 25, 2024
d7ad98b
Merge pull request #279 from sumesh-aot/feature/FWF-3380-bpm-group-ro…
auslin-aot Jun 26, 2024
2d35024
Merge pull request #2119 from shuhaib-aot/Feature/FWF-3327-secure-end…
shuhaib-aot Jun 26, 2024
d0074ba
FWF:3327 [feature] Modified auth role checking function
shuhaib-aot Jun 26, 2024
eec0af1
FWF:3327 [Modified] utils urls
shuhaib-aot Jun 26, 2024
c72f917
Merge pull request #2120 from shuhaib-aot/Feature/FWF-3327-auth-funct…
shuhaib-aot Jun 27, 2024
4d563b6
FWF-3326: [Feature] Added permission matrix changes for design, task,…
Bonymol-aot Jun 27, 2024
6d8ad89
FWF-3326: [Feature] Added permission matrix changes for filter, merge…
Bonymol-aot Jun 28, 2024
21a2e1f
FWF-3326: [Feature] File formatting
Bonymol-aot Jun 28, 2024
2683a53
FWF-3432: [Feature] Added permission matrix changes for filter
Bonymol-aot Jul 1, 2024
cb94036
Update permissions.js
Bonymol-aot Jul 2, 2024
099f6a4
FWF-3380: [Feature] Added mtched user roles to groups
auslin-aot Jun 26, 2024
6fe6ae8
Merge pull request #2105 from abilpraju-aot/feature/FWF-3355-Keycloak…
arun-s-aot Jul 2, 2024
13d8b2b
FWF-3380: [Feature] Added view_designs to the harded roles
auslin-aot Jul 3, 2024
78bd2d2
Merge branch 'feature/FWF-3316-permission-matrix' of https://github.c…
auslin-aot Jul 3, 2024
ec24719
FWF-3380: [Feature] Updated test cases
auslin-aot Jul 3, 2024
004e584
Merge pull request #2126 from Bonymol-aot/feature/FWF-3326-permission…
arun-s-aot Jul 5, 2024
cd438cb
Updating image tag and microfrontend version to try out RBAC changes …
sumesh-aot Jul 5, 2024
c1b4993
Merge pull request #2129 from auslin-aot/feature/FWF-3380-bpm-group-r…
arun-s-aot Jul 5, 2024
3962aa9
❇️ [webapi] Router level authorization check and adding permission m…
shuhaib-aot Jul 8, 2024
52e4445
FWF-3326: [Bugfix] Code formatted
Bonymol-aot Jul 8, 2024
f2b2906
Feature/FWF:3478 changed testcase based on matrix permission (#2140)
shuhaib-aot Jul 10, 2024
b780ace
Reworked structure (#2141)
shuhaib-aot Jul 10, 2024
9241b74
Merge pull request #2137 from Bonymol-aot/FWF-3326-matrix-code-format…
arun-s-aot Jul 11, 2024
6bf2017
Changed user role mapping to group mapping
shuhaib-aot Jul 11, 2024
aad5e4f
Merge pull request #2143 from shuhaib-aot/Feature/FWF-3399-webapi-cha…
arun-s-aot Jul 12, 2024
b221ad8
FWF-3403: [Feature] Error handling while role mapping (#2145)
auslin-aot Jul 15, 2024
051d12a
FWF-3472: [Feature] Test case updates permission matrix
auslin-aot Jul 16, 2024
410751e
FWF-3255:[BUGFIX] Fixed showing form not published issue
fahad-aot Jul 17, 2024
db33567
FWF:3499 [bugfix] fixed form submission in permission matrix
shuhaib-aot Jul 18, 2024
404035b
FWF:3502 [bugfix] Fixed view design permission in form table
shuhaib-aot Jul 18, 2024
a9a8fd5
FWF:3509 [bugfix] fixed /locale authorization
shuhaib-aot Jul 18, 2024
8c133f2
FWF-3499 [bugfix] removed authorization check
shuhaib-aot Jul 18, 2024
383f90d
Merge pull request #2152 from shuhaib-aot/bugfix/FWF-3502-fixing-view…
arun-s-aot Jul 18, 2024
279ffd9
Merge pull request #2150 from shuhaib-aot/bugfix/FWF-3499-Issue-relat…
auslin-aot Jul 18, 2024
69eabbf
Merge pull request #2153 from shuhaib-aot/bugfix/FWF-3509-fixing-lang…
arun-s-aot Jul 18, 2024
4d986c7
Merge branch 'feature/FWF-3316-permission-matrix' of https://github.c…
auslin-aot Jul 18, 2024
18eb11b
FWF-3472: [Feature] Test case updates permission matrix
auslin-aot Jul 18, 2024
3b9b500
FWF-3458: [Bugfix] List only tenant groups
auslin-aot Jul 19, 2024
20a691d
Merge pull request #2147 from auslin-aot/feature/FWF-3472-testcase-up…
arun-s-aot Jul 19, 2024
ebcce23
Merge branch 'feature/FWF-3316-permission-matrix' of https://github.c…
auslin-aot Jul 19, 2024
500ed5e
Merge pull request #2156 from auslin-aot/bugfix/FWF-3458-list-tenant-…
arun-s-aot Jul 19, 2024
bf9c892
updated the admin permision
abilpraju-aot Jul 22, 2024
f94ef7f
requirement added
abilpraju-aot Jul 22, 2024
cdd7f41
FWF-3450:[Feature]-replaced the posision of created by (#2158)
Josephalexantony-aot Jul 23, 2024
8d41303
Fixed designer view (#2159)
shuhaib-aot Jul 23, 2024
e371b72
Bugfix/fwf 3502 rework (#2160)
shuhaib-aot Jul 23, 2024
7941338
Fixed designer view and added new function in utils
shuhaib-aot Jul 23, 2024
be20bbe
Fixed designer view and added new function in utils (#2161)
shuhaib-aot Jul 23, 2024
566846e
Merge branch 'feature/FWF-3316-permission-matrix' of https://github.c…
shuhaib-aot Jul 23, 2024
911cbe3
Merge pull request #2157 from abilpraju-aot/bugfix/FWF-3501-admin-rol…
arun-s-aot Jul 24, 2024
1d6728f
Merge pull request #2149 from fahad-aot/bugfix/FWF-3255-form-not-publ…
arun-s-aot Jul 24, 2024
4516b4f
updated auth method for submission
abilpraju-aot Jul 24, 2024
de05d86
updated requiremnts
abilpraju-aot Jul 24, 2024
fd6f690
Merge pull request #2162 from abilpraju-aot/bugfix/draft-submission
auslin-aot Jul 24, 2024
ccda3bb
FWF-3523 [bugfix] fixed Redirecting to task page
shuhaib-aot Jul 24, 2024
9267ec8
Merge pull request #2163 from AOT-Technologies/Bugfix/FWF-3523-Redire…
auslin-aot Jul 24, 2024
630ef30
Feature/fwf3399 user endpoint changes (#2164)
shuhaib-aot Jul 25, 2024
1a166eb
Merge branch 'feature/FWF-3316-permission-matrix' of https://github.c…
shuhaib-aot Jul 25, 2024
c045dce
Merge branch 'develop' of https://github.com/AOT-Technologies/forms-f…
shuhaib-aot Jul 25, 2024
78249e7
Merge pull request #2165 from shuhaib-aot/Feature/FWF-3316-permission…
shuhaib-aot Jul 25, 2024
adc8be8
FWF-3488: [Feature] Webapi export support endpoint
auslin-aot Jul 25, 2024
88a6b9d
FWF-3488: [Feature] Added Test cases
auslin-aot Jul 29, 2024
677e793
Merge pull request #2166 from AOT-Technologies/feature/FWF-3316-permi…
shuhaib-aot Jul 30, 2024
9884531
Modifed version from 6.1.0-alpha to 7.0.0-alpha
shuhaib-aot Jul 30, 2024
eae8f57
Removed feature/FWF-3316-permission-matrix branch form github actions
shuhaib-aot Jul 30, 2024
1d15e95
FWF-3488: [Feature] Update fetch xml with tenant key
auslin-aot Jul 30, 2024
eb02d23
Merge branch 'develop' of https://github.com/AOT-Technologies/forms-f…
auslin-aot Jul 30, 2024
52a30a0
FWF-3488: [Feature] Testcase update
auslin-aot Jul 30, 2024
e91cefb
Pytest fix
auslin-aot Jul 30, 2024
a9d9829
Fixed bug in user assigne list in task header
shuhaib-aot Jul 31, 2024
0469309
Merge pull request #2168 from shuhaib-aot/Modified/version-changed-7.…
shuhaib-aot Jul 31, 2024
957d157
Merge pull request #2169 from shuhaib-aot/bugfix/assign-fix
shuhaib-aot Jul 31, 2024
ca11615
Merge pull request #2167 from auslin-aot/feature/FWF-3488-webapi-expo…
shuhaib-aot Jul 31, 2024
960ac10
FWF-3539: [Bugfix] export pdf permission matrix changes
auslin-aot Jul 31, 2024
923d195
FWF-3541: [Feature] Default group import changes
auslin-aot Jul 31, 2024
fde6cd2
Merge pull request #2170 from auslin-aot/bugfix/FWF-3539-export-pdf-p…
arun-s-aot Jul 31, 2024
bd07536
Merge pull request #2171 from auslin-aot/feature/FWF-3541-default-gro…
arun-s-aot Aug 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v6.1.0-alpha
v7.0.0-alpha
10 changes: 5 additions & 5 deletions deployment/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ services:

forms-flow-forms:
container_name: forms-flow-forms
image: formsflow/forms-flow-forms:v6.1.0-alpha
image: formsflow/forms-flow-forms:v7.0.0-alpha

# The app will restart until Mongo is listening
restart: always
Expand Down Expand Up @@ -137,10 +137,10 @@ services:
context: ./../../forms-flow-web-root-config/
dockerfile: Dockerfile
args:
- MF_FORMSFLOW_WEB_URL=${MF_FORMSFLOW_WEB_URL:-https://forms-flow-microfrontends.aot-technologies.com/forms-flow-web@v6.1.0-alpha/forms-flow-web.gz.js}
- MF_FORMSFLOW_NAV_URL=${MF_FORMSFLOW_NAV_URL:-https://forms-flow-microfrontends.aot-technologies.com/forms-flow-nav@v6.1.0-alpha/forms-flow-nav.gz.js}
- MF_FORMSFLOW_SERVICE_URL=${MF_FORMSFLOW_SERVICE_URL:-https://forms-flow-microfrontends.aot-technologies.com/forms-flow-service@v6.1.0-alpha/forms-flow-service.gz.js}
- MF_FORMSFLOW_ADMIN_URL=${MF_FORMSFLOW_ADMIN_URL:-https://forms-flow-microfrontends.aot-technologies.com/forms-flow-admin@v6.1.0-alpha/forms-flow-admin.gz.js}
- MF_FORMSFLOW_WEB_URL=${MF_FORMSFLOW_WEB_URL:-https://forms-flow-microfrontends.aot-technologies.com/forms-flow-web@v7.0.0-alpha/forms-flow-web.gz.js}
- MF_FORMSFLOW_NAV_URL=${MF_FORMSFLOW_NAV_URL:-https://forms-flow-microfrontends.aot-technologies.com/forms-flow-nav@v7.0.0-alpha/forms-flow-nav.gz.js}
- MF_FORMSFLOW_SERVICE_URL=${MF_FORMSFLOW_SERVICE_URL:-https://forms-flow-microfrontends.aot-technologies.com/forms-flow-service@v7.0.0-alpha/forms-flow-service.gz.js}
- MF_FORMSFLOW_ADMIN_URL=${MF_FORMSFLOW_ADMIN_URL:-https://forms-flow-microfrontends.aot-technologies.com/forms-flow-admin@v7.0.0-alpha/forms-flow-admin.gz.js}
- NODE_ENV=${NODE_ENV:-production}
entrypoint: /bin/sh -c "/usr/share/nginx/html/config/env.sh && nginx -g 'daemon off;'"
environment:
Expand Down
8 changes: 4 additions & 4 deletions deployment/docker/sample.env
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,12 @@ CUSTOM_SUBMISSION_URL=http://{your-ip-address}:{port}
#The MF Variables below are used to get MicroFrontend Components Created

##For running locally or if have custom changes then change the url to the one forms-flow-web folder content is running
#MF_FORMSFLOW_WEB_URL=https://forms-flow-microfrontends.aot-technologies.com/forms-flow-web@v6.1.0-alpha/forms-flow-web.gz.js
#MF_FORMSFLOW_WEB_URL=https://forms-flow-microfrontends.aot-technologies.com/forms-flow-web@v7.0.0-alpha/forms-flow-web.gz.js

## Refer Github Repo https://github.com/AOT-Technologies/forms-flow-ai-micro-front-ends and update to your own custom implementation for the Components here
#MF_FORMSFLOW_NAV_URL=https://forms-flow-microfrontends.aot-technologies.com/forms-flow-nav@v6.1.0-alpha/forms-flow-nav.gz.js
#MF_FORMSFLOW_SERVICE_URL=https://forms-flow-microfrontends.aot-technologies.com/forms-flow-service@v6.1.0-alpha/forms-flow-service.gz.js
#MF_FORMSFLOW_ADMIN_URL=https://forms-flow-microfrontends.aot-technologies.com/forms-flow-admin@v6.1.0-alpha/forms-flow-admin.gz.js
#MF_FORMSFLOW_NAV_URL=https://forms-flow-microfrontends.aot-technologies.com/forms-flow-nav@v7.0.0-alpha/forms-flow-nav.gz.js
#MF_FORMSFLOW_SERVICE_URL=https://forms-flow-microfrontends.aot-technologies.com/forms-flow-service@v7.0.0-alpha/forms-flow-service.gz.js
#MF_FORMSFLOW_ADMIN_URL=https://forms-flow-microfrontends.aot-technologies.com/forms-flow-admin@v7.0.0-alpha/forms-flow-admin.gz.js

#++++++++++++++++--- formsflow.ai Web Microfrontend components ENV Variables - STOP ---+++++++++++++++++++++++++#

Expand Down
2 changes: 1 addition & 1 deletion forms-flow-api-utils/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def read_requirements(filename):

setuptools.setup(
name='formsflow_api_utils',
version='6.1.0',
version='7.0.0',
author='AOT Technologies',
description='Formsflow api related libraries.',
long_description=read("README.md"),
Expand Down
19 changes: 18 additions & 1 deletion forms-flow-api-utils/src/formsflow_api_utils/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,26 @@
NEW_APPLICATION_STATUS,
REVIEWER_GROUP,
HTTP_TIMEOUT,
PERMISSIONS
)
from .enums import ApplicationSortingParameters
from .permisions import (
PERMISSION_DETAILS ,
CREATE_DESIGNS,
VIEW_DESIGNS,
CREATE_SUBMISSIONS,
VIEW_SUBMISSIONS,
VIEW_DASHBOARDS,
VIEW_TASKS,
MANAGE_TASKS,
MANAGE_ALL_FILTERS,
CREATE_FILTERS,
VIEW_FILTERS,
MANAGE_INTEGRATIONS,
MANAGE_DASHBOARD_AUTHORIZATIONS,
MANAGE_USERS,
MANAGE_ROLES,
ADMIN,
)
from .file_log_handler import CustomTimedRotatingFileHandler, register_log_handlers
from .format import CustomFormatter
from .logging import setup_logging, log_bpm_error
Expand Down
7 changes: 6 additions & 1 deletion forms-flow-api-utils/src/formsflow_api_utils/utils/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ def wrapper(*args, **kwargs):
def has_role(cls, role):
"""Method to validate the role."""
return jwt.validate_roles(role)

@classmethod
def has_any_role(cls, role):
"""Method to validate the role."""
return jwt.contains_role(role)

@classmethod
def require_custom(cls, f):
Expand All @@ -80,4 +85,4 @@ def decorated(*args, **kwargs):

auth = (
Auth()
) # pylint: disable=invalid-name; lower case name as used by convention in most Flask apps
) # pylint: disable=invalid-name; lower case name as used by convention in most Flask apps
73 changes: 1 addition & 72 deletions forms-flow-api-utils/src/formsflow_api_utils/utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,75 +46,4 @@

DEFAULT_PROCESS_KEY = "Defaultflow"
DEFAULT_PROCESS_NAME = "Default Flow"
HTTP_TIMEOUT = 30

PERMISSIONS = [{
"name": "create_designs",
"description": "Create Form, workflow designs",
"depends_on": ["view_designs"]
},
{
"name": "view_designs",
"description": "Access to design",
"depends_on": []
},
{
"name": "create_submissions",
"description": "Create submissions",
"depends_on": []
},
{
"name": "view_submissions",
"description": "Access to submissions",
"depends_on": []
},
{
"name": "view_dashboards",
"description": "Access to dashboards",
"depends_on": []
},
{
"name": "view_tasks",
"description": "Access to tasks",
"depends_on": []
},
{
"name": "manage_tasks",
"description": "Can claim and work on tasks",
"depends_on": ["view_tasks"]
},{
"name": "manage_all_filters",
"description": "Manage all filters",
"depends_on": ["view_filters","create_filters"]
},
{
"name": "create_filters",
"description": "Access to create filters",
"depends_on": ["view_filters"]
},
{
"name": "view_filters",
"description": "Access to view filters",
"depends_on": []
},
{
"name": "manage_integrations",
"description": "Access to Integrations",
"depends_on": []
},
{
"name": "manage_dashboard_authorizations",
"description": "Manage Dashboard Authorization",
"depends_on": ["view_dashboards"]
},
{
"name": "manage_users",
"description": "Manage Users",
"depends_on": []
},
{
"name": "manage_roles",
"description": "Manage Roles",
"depends_on": ["manage_users"]
}
]
HTTP_TIMEOUT = 30
46 changes: 46 additions & 0 deletions forms-flow-api-utils/src/formsflow_api_utils/utils/permisions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
"""Permission definitions."""

CREATE_DESIGNS = "create_designs"
VIEW_DESIGNS = "view_designs"
CREATE_SUBMISSIONS = "create_submissions"
VIEW_SUBMISSIONS = "view_submissions"
VIEW_DASHBOARDS = "view_dashboards"
VIEW_TASKS = "view_tasks"
MANAGE_TASKS = "manage_tasks"
MANAGE_ALL_FILTERS = "manage_all_filters"
CREATE_FILTERS = "create_filters"
VIEW_FILTERS = "view_filters"
MANAGE_INTEGRATIONS = "manage_integrations"
MANAGE_DASHBOARD_AUTHORIZATIONS = "manage_dashboard_authorizations"
MANAGE_USERS = "manage_users"
MANAGE_ROLES = "manage_roles"
ADMIN= "admin"

PERMISSION_DETAILS = [
{"name": CREATE_DESIGNS , "description": "Create Form, workflow designs", "depends_on": [ VIEW_DESIGNS ]},
{"name": VIEW_DESIGNS , "description": "Access to design", "depends_on": []},
{"name": CREATE_SUBMISSIONS , "description": "Create submissions", "depends_on": []},
{"name": VIEW_SUBMISSIONS , "description": "Access to submissions", "depends_on": []},
{"name": VIEW_DASHBOARDS , "description": "Access to dashboards", "depends_on": []},
{"name": VIEW_TASKS , "description": "Access to tasks", "depends_on": []},
{"name": MANAGE_TASKS , "description": "Can claim and work on tasks", "depends_on": [ VIEW_TASKS ]},
{"name": MANAGE_ALL_FILTERS , "description": "Manage all filters", "depends_on": [ VIEW_FILTERS , CREATE_FILTERS ]},
{"name": CREATE_FILTERS , "description": "Access to create filters", "depends_on": [ VIEW_FILTERS ]},
{"name": VIEW_FILTERS , "description": "Access to view filters", "depends_on": []},
{"name": MANAGE_INTEGRATIONS , "description": "Access to Integrations", "depends_on": []},
{"name": MANAGE_DASHBOARD_AUTHORIZATIONS , "description": "Manage Dashboard Authorization", "depends_on": [ VIEW_DASHBOARDS ]},
{"name": MANAGE_USERS , "description": "Manage Users", "depends_on": []},
{"name": MANAGE_ROLES , "description": "Manage Roles", "depends_on": [ MANAGE_USERS ]},
{"name": ADMIN , "description": "Administrator Role", "depends_on": [ MANAGE_ROLES , MANAGE_USERS ]},
]


def build_permission_dict():
"""
Builds a dictionary of permissions where the key is the permission name and
the value is the permission detail.

Returns:
dict: A dictionary of permission details.
"""
return {permission["name"]: permission for permission in PERMISSION_DETAILS}
9 changes: 0 additions & 9 deletions forms-flow-api-utils/src/formsflow_api_utils/utils/roles.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ def email(self) -> str:
def roles(self) -> List[str]:
"""Return the roles."""
return self._roles

@property
def groups(self) -> List[str]:
"""Return the roles."""
return self._groups

@property
def group_or_roles(self) -> List[str]:
Expand Down
18 changes: 11 additions & 7 deletions forms-flow-api-utils/src/formsflow_api_utils/utils/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@

from .constants import (
ALLOW_ALL_ORIGINS,
CLIENT_GROUP,
DESIGNER_GROUP,
REVIEWER_GROUP,
)
from .enums import (
ApplicationSortingParameters,
Expand All @@ -23,7 +20,14 @@
ProcessSortingParameters,
)
from .translations.translations import translations

from .permisions import (
CREATE_DESIGNS,
VIEW_DESIGNS,
MANAGE_TASKS,
VIEW_TASKS,
CREATE_SUBMISSIONS,
VIEW_SUBMISSIONS,
)

def cors_preflight(methods: str = "GET"):
"""Render an option method on the class."""
Expand Down Expand Up @@ -108,11 +112,11 @@ def get_role_ids_from_user_groups(role_ids, user_role):
if role_ids is None or user_role is None:
return None

if DESIGNER_GROUP in user_role:
if any(permission in user_role for permission in [ CREATE_DESIGNS, VIEW_DESIGNS]):
return role_ids
if REVIEWER_GROUP in user_role:
if any(permission in user_role for permission in [ MANAGE_TASKS, VIEW_TASKS]):
return filter_list_by_user_role(FormioRoles.REVIEWER.name, role_ids)
if CLIENT_GROUP in user_role:
if any(permission in user_role for permission in [ CREATE_SUBMISSIONS, VIEW_SUBMISSIONS]):
return filter_list_by_user_role(FormioRoles.CLIENT.name, role_ids)
return None

Expand Down
2 changes: 1 addition & 1 deletion forms-flow-api/requirements/prod.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ sqlalchemy_utils
markupsafe
PyJWT
redis
git+https://github.com/AOT-Technologies/forms-flow-ai.git@develop#egg=formsflow_api_utils&subdirectory=forms-flow-api-utils
git+https://github.com/AOT-Technologies/forms-flow-ai.git@develop#subdirectory=forms-flow-api-utils
2 changes: 1 addition & 1 deletion forms-flow-api/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = formsflow_api
version = 6.1.0
version = 7.0.0
author = aot-technologies
classifiers =
Development Status :: Production
Expand Down
2 changes: 1 addition & 1 deletion forms-flow-api/src/formsflow_api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def create_app(
when=os.getenv("API_LOG_ROTATION_WHEN", "d"),
interval=int(os.getenv("API_LOG_ROTATION_INTERVAL", "1")),
backupCount=int(os.getenv("API_LOG_BACKUP_COUNT", "7")),
configure_log_file=app.config["CONFIGURE_LOGS"]
configure_log_file=app.config["CONFIGURE_LOGS"],
)

app.logger.propagate = False
Expand Down
4 changes: 3 additions & 1 deletion forms-flow-api/src/formsflow_api/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ class _Config: # pylint: disable=too-few-public-methods
# Keycloak Admin Service
KEYCLOAK_URL = os.getenv("KEYCLOAK_URL")
KEYCLOAK_URL_REALM = os.getenv("KEYCLOAK_URL_REALM")
KEYCLOAK_URL_HTTP_RELATIVE_PATH = os.getenv("KEYCLOAK_URL_HTTP_RELATIVE_PATH", "/auth")
KEYCLOAK_URL_HTTP_RELATIVE_PATH = os.getenv(
"KEYCLOAK_URL_HTTP_RELATIVE_PATH", "/auth"
)

# Web url
WEB_BASE_URL = os.getenv("WEB_BASE_URL")
Expand Down
5 changes: 5 additions & 0 deletions forms-flow-api/src/formsflow_api/constants/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ class BusinessErrorCode(ErrorCodeMixin, Enum):
HTTPStatus.BAD_REQUEST,
)
PROCESS_DEF_NOT_FOUND = "Process definition does not exist", HTTPStatus.BAD_REQUEST
DECISION_DEF_NOT_FOUND = (
"Decision definition does not exist",
HTTPStatus.BAD_REQUEST,
)
INVALID_AUTH_RESOURCE_ID = (
"Invalid authorization resource ID",
HTTPStatus.BAD_REQUEST,
Expand Down Expand Up @@ -61,6 +65,7 @@ class BusinessErrorCode(ErrorCodeMixin, Enum):
)
THEME_NOT_FOUND = "The specified theme not exist", HTTPStatus.BAD_REQUEST
THEME_EXIST = "The specified theme already exist", HTTPStatus.BAD_REQUEST
ROLE_MAPPING_FAILED = "Role mapping failed", HTTPStatus.BAD_REQUEST

def __new__(cls, message, status_code):
"""Constructor."""
Expand Down
Loading
Loading