0 votes

Hello,

My "Employees" Security Role has the ability to write the 'Picture' property on Self only.
Employees are able to edit and delete their own picture, but I want to have managers approve the operation before this happens.

I've set up a business rule as below:

and applied it to all users. However, users are able to change their picture without any approval.

Is there some way for me to set up the Business Rule to require manager approval before changing the picture?

Thanks,
Dan

by (1.1k points)
0

Hello Dan,

The Business Rule looks good.

Make sure that the user who is changing the picture is not in the list of Approvers. If an Approver is trying to change the picture, then the action will be performed without any approval request.

Also, can you post a screenshot of the activity scope of your Business Rule?

0

This is the 'Employees' Security Role as well

0

Dan,

The activity scope of a Business Rule is shown below the actions and conditions of that Business Rule:

Can you post a screenshot of the activity scope of your Business Rule?

0

Well, that's embarrassing. I didn't have anything in that scope. I assigned it over all objects and now it's working. :oops:

Thanks for pointing that out.

1 Answer

0 votes
by (1.1k points)

Alright, new question:

This is the approval email that is sent when someone requests a picture change.

Is there a way to have a preview of the photo that is requested, instead of the hex code?

0

Dan,

Unfortunately, currently this is impossible. We will discuss this as a feature suggestion with our team.

0

Is there a location that the uploaded picture is stored, while it waits to be approved? I can't ask our managers to approve photos without being able to preview them before approving.

I tried creating a Business Rule action to send an email with the %thumbnailPhoto% field as part of the body, but unfortunately that returns only a very long string of characters (I assume the code of the photo itself, not any use)

Any help or suggestions you may have that could function as a workaround would be helpful.

Thanks,
Dan

0

Hello Dan,

We suggest the following workaround.

In your Business Rule that sends the operation for approval insert the Run a program or PowerShell script action before the Send this operation for approval action and paste the following script:

$thumbnailPhotoBytes = $Context.GetModifiedPropertyValue("thumbnailPhoto")

# Convert the photo to Base 64
$thumbnailPhotoBase64 = [System.Convert]::ToBase64String($thumbnailPhotoBytes)

$to = "jsmith@domain.com" # TODO: modify me
$subject = "My Subject"
$bodyText = $NULL
$bodyHtml = @"
The image of user %name% (%username%) will be changed to:<br />
<img src='data:image/jpg;base64,$thumbnailPhotoBase64' alt='User image'>
"@

$Context.SendMail($to, $subject, $bodyText, $bodyHtml)

The script will send the modified picture to the email address specified in the $to variable.

So, if you specify a manager's email in the script, he will actually receive 2 emails: one containing the image and sent by the script, and another one sent by the Send this operation for approval action.

0

That's perfect, and exactly what I was looking for. Thanks so much guys!

I implemented this code, and the email works. However, I get the following:

The red X shows up in place of the picture. I'm sure this is something small I'm missing. Any insight?

0

Hello Dan,

What is the version of your Internet Explorer?

0

The server is running IE8, and my workstation is on IE9.

All machines in the company are on at least IE8.

The server running Adaxes is 2008R2.

0

Hello Dan,

This is because Microsoft Outlook does not recognize attachments placed inline of an html message. Our script guy is working on a some sort of workaround for this issue, we'll update you as soon as he comes up with some solution.

0

Sounds good, thanks.

0

Hello Dan,

Here's a modified script:

$smtpServer = "smtp.myserver.com" #TODO: modify me
$to = "user@example.com" #TODO: modify me

# Create an instance of the MailMessage class
$msg = New-Object Net.Mail.MailMessage
$msg.Subject = "My subject"
$msg.From = "nobody@localhost"
$msg.To.Add($to)

$html = {
<html>
  <head>
  <head>
  <body>
    The image of user %name% (%username%) will be changed to:<br />
    <img src='cid:photo' alt='photo'/>                              
  </body>
</html>
}
$view = [Net.Mail.AlternateView]::CreateAlternateViewFromString($html, $null, "text/html");
 # Create attachment
$thumbnailPhotoBytes = $Context.GetModifiedPropertyValue("thumbnailPhoto")
$stream = New-Object System.IO.MemoryStream @(,$thumbnailPhotoBytes)
$linkedResource = New-Object Net.Mail.LinkedResource($stream)
$linkedResource.ContentId = "photo"
$view.LinkedResources.Add($linkedResource)
$msg.AlternateViews.Add($view)

$smtp = New-Object Net.Mail.SmtpClient($smtpServer)
$smtp.Send($msg)

$linkedResource.Dispose()
$stream.Dispose()
0

That works perfectly! Thanks guys, I appreciate the responses and code.

Related questions

0 votes
1 answer

Adaxes seems to want to use the Manager field to specify who gets approval confirmation emails. What do you do about a user without a manager, such as the CEO? Let's assume they're not tech saavy, and the IT department needs to confirm their requests.

asked Feb 10 by Liam (250 points)
0 votes
1 answer

Hi again Adaxes aleardy propose to submit action to requestor manager. I would find very usefull to submit action to object manager : if a want to modify a user object, the approval would be sent to user's manager. Does it make sense ? Thanks

asked Jun 1, 2011 by sroux (7k points)
0 votes
1 answer

Hi, We are in process of implementing the User Creation/Deletion &amp; Add/Remove Users to Group. We have been using the Canonical name ... /errorMessage&gt; &lt;/addResponse&gt; &lt;/ProcessRequestResult&gt; &lt;/ProcessRequestResponse&gt; Thanks, Aravindh

asked Nov 20, 2018 by Aravindh (510 points)
0 votes
1 answer

Hello, I'm looking for a way to receive a notification/approval request when a new user is created and the business rule attempts to assign O365 licensing, however ... dependent on the license being assigned. Looking for any suggestions! Thanks so much!

asked Jul 1, 2019 by ryan_breneman (4.9k points)
0 votes
0 answers

Hi, Is it possible to create reports for the approvals element of Adaxes? Like "Top 10 approvers" that is a rank of the count of the number of approvals individuals have made, ... ) something like that, oh, and be run from the reports tab in web maybe? John.

asked Jul 21, 2015 by bistromath (4.3k points)
2,246 questions
2,007 answers
5,494 comments
19,958 users