Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Best practice for alerts on a page

Posted on 2016-07-16
3
39 Views
Last Modified: 2016-07-17
Hi All

We have a page that displays data on meeting - these have meta data pertaining to them like IsApproved, IsComplete etc. Users interact with this data and have certain permissions like CanEdit, CanUpdate, CanAdd etc to display warnings or show hide buttons etc.

I have done this routinely with nested if's... or  switch...statements.

This app is a bit more complex, what is best practice for this sort of thing?

Andy
0
Comment
Question by:Andy Green
3 Comments
 
LVL 80

Accepted Solution

by:
David Johnson, CD, MVP earned 350 total points
ID: 41715072
you could use bitwise AND/OR

int permissions
CanEdit        0x01
CanUpdate 0x02
CanAdd        0x04

user has edit and update  == permission would be 3
edit/update/add                       permission would be 7
update/add                               permission would be 6

There are too many ways of doing this but this is one way
0
 
LVL 27

Assisted Solution

by:BigRat
BigRat earned 150 total points
ID: 41715750
0
 
LVL 3

Author Closing Comment

by:Andy Green
ID: 41716322
Thanks guys - Like the bitwise as its a method I'm familiar with.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

838 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question