IT Monkey will place code here as examples of what Cireson's consulting team has to offer as well as examples for public consumption to benefit the Microsoft System Center community as a whole.
DISCLAIMER
All files and projects located here come as is and without any warranty or support. We will attempt to improve the projects as time goes on based on customer and community demand. Comments and improvements are welcome as well as customization requests. Your use of these Cireson Uploads is subject to our Terms of Use.
Cireson's support team has no information on these projects outside of what you have available and will not provide support for these enhancements, extensions, and scripts.
Dont forget to checkout solutions uploaded by our customers, partners and community members here.
Only Allow Reviewers To Approve Review Activities
This is a Cireson Portal extension to try and get around the issue where a user can approve an RA where they are not an reviewer. The code checks the reviewer list, enumerates members of any AD Groups that are reviewers and if the current user is not in that list, the Approve and Reject buttons are disabled.
With this applied and logged on as me, I can still approve my own RA.
However when I open an RA where I am not a reviewer, (NB: I am a Portal Analyst and even a SCSM Admin)
the button are disabled.
I hope this helps with this issue, and feedback welcome as always and please re-upload any improvements you make to it.
Kudos to @joivan_hedrick for this one.
Geoff
Comments
OnlyAllowReviewersToReviewActivities.js
in theGetActivityElementsFromViewModelActivities()
function (line 208), add an if-statement, which checks whether the user is a member of your Change Managers group, e.g.:This should ensure, that if the logged on user is a member of that group, they will be able to approve or reject any activity.
@Konstantin_Slavin-Bo, this worked perfectly. Thanks!
Is this V8 approval page compatible?
My suggestion is to add the following to line 202, which will provide you the groups that the logged in user is a member of. Allowing to identify how the group is displayed, then validate it matches the value you are using in line 239.
console.log("Logged in User Groups: " + session.user.ReviewActivityGroups)
do I need to change DOMAIN to my domain?
Yes Eric, you will need to change domain to your domain name.
If you continue to have issues, see my note above that can aid in identify the appropriate group syntax for your environment.
1. The approve all / reject all buttons do not show - Good
2. If I am not the named review, I cannot approve/reject - Good
3. If I am the named reviewer, I can approve/reject - Good
4. If I am in a group that is the named reviewer - I cannot approve/reject - Bad
5. If I am in the GlobalApprover group (from above), I cannot approve/reject - Bad
I have sync'd AD Groups to no avail.
What am I missing?
Essentially throw the AD groups to console, where you can
Could you please post the output of the code from Brad? It would help us identify the group and format, which needs to be added.
You could do that by copying over ServiceRequest.js from "C:\inetpub\CiresonPortal\Scripts\forms\templates" and pasting it inside "C:\inetpub\CiresonPortal\CustomSpace".
Then you can create your own section and name it something like "ReadOnlyForm" with all the fields you want displayed and setting them with "Disabled:true"
Then in the portal as admin you go to Admin Settings and under the "Assign forms to active directory groups" section you specify which AD group you'd like to target, then for Form ID you'd use "ReadOnlyForm" and also figure out what type projection GUID will get you all the fields you wish to display.
You'll need to find out the name/ID of the TypeProjection in your MP that you want to use and then use something like powershell to get the GUID it has when imported.
Ex.
Note: I created a SCSM Reviewer Portal but that's about reviews and displaying some basic information from a SR/CR. Good news is source code is included, so you can use Visual Studio 2015 Web Express or something similar to change the portal if needed.
We have hidden this field altogether by modifying the review-activity.html file. This file gets overwritten with each update of the portal. Will it be possible to use these files in the customspace folder in the future or is there another / easier way?
I don't know in which case an end user should be able to modify a review activity at all, at least in our environment. Haven't tried the solution in the post above. That might help.
I am having an issue with this as well, I used the "console.log("Logged in User Groups: " + session.user.ReviewActivityGroups)" bit and got that I am a part of AD\IT - SM Change Management group.
However, when I insert
I get nothing. so I put in "console.log("tis right")" just to see if it was getting to that point, and it is not.
What could I possibly be doing wrong?
Hi @Eric_Evans
Out of curiosity does this work?
I think you need to escape the backslash with another backslash so it uses it in the string.
Thanks,
Shane
Yes! That was the ticket! thank you so much!
No worries :-)
Hello, I'm rather new when it comes to working on the portal customizations. I wanted to ask, how do I get the Approve All/Reject All to not show up on the RAs in the portal? Thanks :)
Hi @Jillian_Hill
Welcome to Cireson Portal Customising.I saw you just completed the Portal eLearning course too. Great work!
Happy to get into this and explain, but if you can wait a week or so, we're actually working on an update to this code which will be easier to implement.
Geoff
Thank you! I'm trying increase my knowledge so I can maximize the potential of the Cireson apps and portal in my organization (job security, am I right? lol). I'll keep a lookout for that update.