Solved

Best practice for alerts on a page

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

Accepted Solution

by:
David Johnson, CD, MVP earned 350 total points
Comment Utility
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
Comment Utility
0
 
LVL 3

Author Closing Comment

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

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This is an explanation of a simple data model to help parse a JSON feed
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
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 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…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now