Solved

Best practice for alerts on a page

Posted on 2016-07-16
3
47 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
[X]
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
3 Comments
 
LVL 81

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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

This is about my first experience with programming Arduino.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
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 …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

738 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