Solved

Best practice for alerts on a page

Posted on 2016-07-16
3
42 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
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…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

740 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