Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
29 replies
Subscribers
4 subscribers
Views
9631 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Plug-Ins
I wrote an expression plug-in that returns a writer. Every thing has worked fin
venkats533
over 9 years ago
I wrote an expression plug-in that returns a writer. Every thing has worked fine when used by a "System Designer" but when attempted to execute as "Basic User", the following error is returned. How do I set security for writer function to allow a "Basic User".
[local!testWriter:The user [test.ccat.submitter] does not have sufficient privileges to perform the requested action.]
OriginalPostID-166633
OriginalPostID-166633
Discussion posts and replies are publicly visible
0
Eduardo Fuentes
Appian Employee
over 9 years ago
Whenever you get an authorization error this log is the key to find out the root cause. Your log shows the following:
test.ccat.submitter,hybrid-service,com.appiancorp.suiteapi.type.TypeService.select,DENIED,,userRoles=[app-user]; rolesAllowingAction=[designer]
This indicates your user test.ccat.submitter is trying to invoke an API method com.appiancorp.suiteapi.type.TypeService.select() which cannot be executed when the user is only an Application User but not a Designer
Two solutions:
1. Re-design the plug-in so it doesn't use TypeService.select()
2. Or use an administrator context just for this particular call (TypeService.select()). The administrator user can be a service account passed via constant to your plug-in.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 9 years ago
Note that for security reasons some API calls are restricted to Designers.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
venkats533
over 9 years ago
I can use secure credential store to pass the administrator user. But can you tell me how to force the administrator context instead of logged in user context ?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
venkats533
over 9 years ago
well I have to check if expression plugin can inject SecureCredentialStore
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 9 years ago
You don't need any credentials just the username:
ServiceContext myOtherAdminUserServiceContext= ServiceContextFactory.getServiceContext(myOtherAdminUser);
m_typeSvc = ServiceLocator.getTypeService(myOtherAdminUserServiceContext)
m_typeSvc
TypedValue oneCDTValue = m_typeSvc.select(m_mainCDTValue, cdtIndexList);
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
venkats533
over 9 years ago
thanks a lot - this is a great learning today.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 9 years ago
Happy to help. Hopefully that's the only API call that's failing.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
venkats533
over 9 years ago
Edurado - now I removed the basic user from Designers and everything is working as usual for basic user. Once again, thanks a lot.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 9 years ago
Great news!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
<