├── Awp0UserSummary.xml
├── README.md
├── src
├── bypass
│ ├── commandsViewModel.json
│ ├── module.json
│ └── src
│ │ ├── html
│ │ └── bypassView.html
│ │ ├── i18n
│ │ └── bypassMessages.json
│ │ ├── image
│ │ ├── cmdBypass24.svg
│ │ └── cmdBypassActive24.svg
│ │ ├── js
│ │ └── bypassCommandService.js
│ │ └── viewmodel
│ │ └── bypassViewModel.json
└── kit.json
└── typePerson48.svg
/Awp0UserSummary.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
16 |
17 |
18 |
21 |
25 |
31 |
34 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
70 |
71 |
72 |
75 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Active Workspace Bypass Customization
2 | ## Version 1.1 Release Notes
3 | - Added command to the Global Navigation toolbar
4 | ### Images
5 | - Added supporting icon images to [image](https://github.com/ActiveWorkspaceExtensions/bypass/tree/main/src/bypass/src/image) which will be included in deployment.
6 | ### Commands View Model
7 | #### Commands
8 | - enableBypassCommand 
9 | - disableBypassCommand 
10 |
11 |
12 | #### Command Handlers
13 | - Handlers call an action to either enable or disable bypass.
14 | #### Command Placements
15 | - Both enable/disable bypass are located on the aw_globalNavigationbar uiAnchor.
16 | #### Actions
17 | - **enableBypass:** SOA service to setUserSessionState value to 1 and subsequent event to reload page allowing refresh of ViewModel object permissions.
18 |
19 | - **disableBypass:** SOA service to setUserSessionState value to 1 and subsequent event to reload page allowing refresh of ViewModel object permissions.
20 | #### On Event
21 | ``` json
22 | "onEvent": [
23 | {
24 | "eventId": "enableBypass.reload",
25 | "action": "reloadPage"
26 | },
27 | {
28 | "eventId": "disableBypass.reload",
29 | "action": "reloadPage"
30 | }
31 | ]
32 | ```
33 | #### Conditions
34 | ```json
35 | "conditions": {
36 | "showEnableBypass": {
37 | "expression": " ctx.userSession.props.group_name.dbValue=='dba' && ctx.userSession.props.role.uiValue=='DBA' && ctx.userSession.props.fnd0bypassflag.dbValues[0] === '0'"
38 | },
39 | "showDisableBypass": {
40 | "expression": "ctx.userSession.props.group_name.dbValue=='dba' && ctx.userSession.props.role.uiValue=='DBA' && ctx.userSession.props.fnd0bypassflag.dbValues[0] === '1'"
41 | }
42 | }
43 | ```
44 |
45 | ___
46 | ## Overview
47 | Customization to disable the rule tree. This gives unrestricted access to objects in Active Workspace.
48 |
49 | ## Deployment Instructions
50 | ### Source Code Deployment
51 | **Copy** and **Paste** the **\src** directory into **%TC_ROOT%\aws2\stage**, then run the following commands in a Teamcenter command terminal:
52 | ``` cmd
53 | cd %TC_ROOT%\aws2\stage
54 | initenv.cmd
55 | awbuild.cmd
56 | ```
57 | ___
58 | ### Stylesheet Modifications
59 | Modify the Awp0UserSummary stylesheet using either the Rich Client or XRTEditor in Active Workspace.
60 |
61 | **A sample of this [stylesheet](https://github.com/ActiveWorkspaceExtensions/bypass/blob/main/Awp0UserSummary.xml) has been included in the solution media.**
62 |
63 | Add the following section to the stylesheet to expose the Bypass Flag checkbox in the User summary stylesheet.
64 | ``` html
65 |
68 | ```
69 | ___
70 | ## Validation
71 | - Login to the Active Workspace Client after successfully running the awbuild.cmd.
72 | - Find an object which the logged in user does not have write access to **(Example in video of an object with *Obsolete* status)**
73 | - Verify that the **Edit** → **Start Edit** command is not available when selecting the object.
74 | - Select on the
icon in the bottom left corner of the client, then select **Profile**.
75 | - Select the aw-checkbox labeled **Bypass Flag** to enable the bypass feature.
76 | - Navigate back to the object and verify **Edit** → **Start Edit** is now available and changes can be made to the object properties.
77 | - To disable Bypass, navigate back to Profile and uncheck the aw-togglebutton.
78 |
79 | https://user-images.githubusercontent.com/44880206/145828924-706769a4-443f-497a-91e5-f349b4fe0f37.mp4
80 |
81 |
82 |
83 | ___
84 | ## Solution Definition
85 |
86 | ### View
87 | #### Elements
88 | - aw-panel
89 | - aw-panel-section
90 | - aw-togglebutton
91 | - visible-when
92 | #### Conditions
93 | - **Group**: dba (ctx.userSession.props.role.uiValue=='DBA')
94 | - **Role**: DBA (ctx.userSession.props.role.uiValue=='DBA')
95 | - **Location**: User Profile (ctx.userSession.props.user.dbValue==ctx.selected.uid)
96 |
97 | ### View Model
98 | #### Imports
99 | ``` json
100 | "js/visible-when.directive",
101 | "js/aw-togglebutton.directive",
102 | "js/aw-panel.directive",
103 | "js/aw-panel-section.directive"
104 | ```
105 | #### Actions
106 | ``` json
107 | "toggle": {
108 | "actionType": "TcSoaService",
109 | "serviceName": "Core-2007-12-Session",
110 | "method": "setUserSessionState",
111 | "inputData": {
112 | "pairs": [{
113 | "name": "fnd0bypassflag",
114 | "value": "{{(ctx.userSession.props.fnd0bypassflag.dbValue) ? '1' : '0'}}"
115 | }]
116 | }
117 | }
118 | ```
119 | #### SOA
120 | 
121 |
122 |
123 |
124 |
125 |
--------------------------------------------------------------------------------
/src/bypass/commandsViewModel.json:
--------------------------------------------------------------------------------
1 | {
2 | "schemaVersion": "1.0.0",
3 | "commands": {
4 | "enableBypassCommand": {
5 | "iconId": "cmdBypass",
6 | "isGroup": false,
7 | "title": "Bypass"
8 | },
9 | "disableBypassCommand": {
10 | "iconId": "cmdBypassActive",
11 | "isGroup": false,
12 | "title": "Bypass"
13 | }
14 | },
15 | "commandHandlers": {
16 | "enableBypassCommandHandler": {
17 | "id": "enableBypassCommand",
18 | "action": "enableBypass",
19 | "activeWhen": {
20 | "condition": "conditions.showEnableBypass"
21 | },
22 | "visibleWhen": {
23 | "condition": "conditions.showEnableBypass"
24 | }
25 | },
26 | "disableBypassCommandHandler": {
27 | "id": "disableBypassCommand",
28 | "action": "disableBypass",
29 | "activeWhen": {
30 | "condition": "conditions.showDisableBypass"
31 | },
32 | "visibleWhen": {
33 | "condition": "conditions.showDisableBypass"
34 | }
35 | }
36 | },
37 | "commandPlacements": {
38 | "enableBypassCommandPlacement": {
39 | "id": "enableBypassCommand",
40 | "uiAnchor": "aw_globalNavigationbar",
41 | "priority": 100
42 | },
43 | "disableBypassCommandPlacement": {
44 | "id": "disableBypassCommand",
45 | "uiAnchor": "aw_globalNavigationbar",
46 | "priority": 100
47 | }
48 | },
49 | "actions": {
50 | "enableBypass": {
51 | "actionType": "TcSoaService",
52 | "serviceName": "Core-2007-12-Session",
53 | "method": "setUserSessionState",
54 | "inputData": {
55 | "pairs": [{
56 | "name": "fnd0bypassflag",
57 | "value": "1"
58 | }]
59 | },
60 | "events": {
61 | "success": [
62 | {
63 | "name": "enableBypass.reload"
64 | }
65 | ]
66 | }
67 | },
68 | "disableBypass": {
69 | "actionType": "TcSoaService",
70 | "serviceName": "Core-2007-12-Session",
71 | "method": "setUserSessionState",
72 | "inputData": {
73 | "pairs": [{
74 | "name": "fnd0bypassflag",
75 | "value": "0"
76 | }]
77 | },
78 | "events": {
79 | "success": [
80 | {
81 | "name": "disableBypass.reload"
82 | }
83 | ]
84 | }
85 | },
86 | "reloadPage": {
87 | "actionType": "JSFunction",
88 | "method": "reloadPage",
89 | "inputData": {},
90 | "deps": "js/workspaceService"
91 | }
92 | },
93 | "onEvent": [
94 | {
95 | "eventId": "enableBypass.reload",
96 | "action": "reloadPage"
97 | },
98 | {
99 | "eventId": "disableBypass.reload",
100 | "action": "reloadPage"
101 | }
102 | ],
103 | "conditions": {
104 | "showEnableBypass": {
105 | "expression": " ctx.userSession.props.group_name.dbValue=='dba' && ctx.userSession.props.role.uiValue=='DBA' && ctx.userSession.props.fnd0bypassflag.dbValues[0] === '0'"
106 | },
107 | "showDisableBypass": {
108 | "expression": "ctx.userSession.props.group_name.dbValue=='dba' && ctx.userSession.props.role.uiValue=='DBA' && ctx.userSession.props.fnd0bypassflag.dbValues[0] === '1'"
109 | }
110 | },
111 | "messages": {},
112 | "i18n": {}
113 | }
--------------------------------------------------------------------------------
/src/bypass/module.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "bypass",
3 | "desc": "This is the bypass module",
4 | "type": [
5 | "native"
6 | ],
7 | "skipTest": true,
8 | "typeProperties": {
9 | "typeProperties": {
10 | "UserSession": {
11 | "additionalProperties": [
12 | {
13 | "name": "fnd0bypassflag"
14 | }
15 | ]
16 | }
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/src/bypass/src/html/bypassView.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/bypass/src/i18n/bypassMessages.json:
--------------------------------------------------------------------------------
1 | {
2 | "enableBypassTitle": "Enable Bypass",
3 | "disableBypassTitle": "Disable Bypass",
4 | "header": "Header",
5 | "body": "Body",
6 | "footer": "Footer",
7 | "checkBoxName": "Enable the OK button in footer",
8 | "save": "Ok",
9 | "textValue": "Contents here",
10 | "bypassCommandTitle": "bypassCommand",
11 | "bypassCommandDescription": "bypassCommandDescription"
12 | }
--------------------------------------------------------------------------------
/src/bypass/src/image/cmdBypass24.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
50 |
--------------------------------------------------------------------------------
/src/bypass/src/image/cmdBypassActive24.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
51 |
--------------------------------------------------------------------------------
/src/bypass/src/js/bypassCommandService.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Simple Alert service for sample command Handlers
3 | *
4 | * @module js/bypassCommandService
5 | */
6 |
7 | /**
8 | * Dummy alert.
9 | * @param {String} text - text to display
10 | */
11 | export let alert2 = function( text ) {
12 | alert( text ); // eslint-disable-line
13 | };
14 |
15 | export default {
16 | alert: alert2
17 | };
18 |
--------------------------------------------------------------------------------
/src/bypass/src/viewmodel/bypassViewModel.json:
--------------------------------------------------------------------------------
1 | {
2 | "schemaVersion": "1.0.0",
3 | "imports": [
4 | "js/visible-when.directive",
5 | "js/aw-togglebutton.directive",
6 | "js/aw-panel.directive",
7 | "js/aw-panel-section.directive"
8 | ],
9 | "data": {
10 | "bypassToggle": {
11 | "displayName": "Bypass",
12 | "type": "BOOLEAN",
13 | "isRequired": "false",
14 | "isEditable": "true",
15 | "dbValue": "ctx.userSession.props.fnd0bypassflag.dbValue",
16 | "uiValue": "ctx.userSession.props.fnd0bypassflag.uiValue",
17 | "labelPosition": "PROPERTY_LABEL_AT_SIDE"
18 | }
19 | },
20 | "actions": {
21 | "toggle": {
22 | "actionType": "TcSoaService",
23 | "serviceName": "Core-2007-12-Session",
24 | "method": "setUserSessionState",
25 | "inputData": {
26 | "pairs": [{
27 | "name": "fnd0bypassflag",
28 | "value": "{{(ctx.userSession.props.fnd0bypassflag.dbValue) ? '1' : '0'}}"
29 | }]
30 | }
31 | }
32 | }
33 | }
--------------------------------------------------------------------------------
/src/kit.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "bypass",
3 | "level": 7,
4 | "kitDeps": [
5 | "tc-aw-solution"
6 | ],
7 | "modules": [
8 | "bypass"
9 | ]
10 | }
--------------------------------------------------------------------------------
/typePerson48.svg:
--------------------------------------------------------------------------------
1 |
21 |
--------------------------------------------------------------------------------