So I have created a new AppPermission Pages_Administration_Users_List
In UserAppService can i combine class permissions and method permissions?
[AbpAuthorize(AppPermissions.Pages_Administration_Users)]
public class UserAppService : PhoogleZeroAppServiceBase, IUserAppService
and then in method GetBirthdayList
[AbpAuthorize(AppPermissions.Pages_Administration_Users_List)]
public async Task<ListResultDto<UserListDto>> GetBirthDayList()
{
var query = from u in UserManager.Users.Where(u => u.IsActive)
let diffYears = DbFunctions.DiffYears(u.DateOfBirth, DateTime.Today)
let birthdayOccurred =
u.DateOfBirth.Month < DateTime.Today.Month
|| ((u.DateOfBirth.Day + 3) <= DateTime.Today.Day && u.DateOfBirth.Month == DateTime.Today.Month)
let nextBirthdate = DbFunctions.AddYears(u.DateOfBirth, diffYears + (birthdayOccurred ? 1 : 0))
let daysToBirthdate = DbFunctions.DiffDays(DateTime.Today, nextBirthdate)
orderby daysToBirthdate
select u;
var users = await query.Take(12).ToListAsync();
return new ListResultDto<UserListDto>(users.MapTo<List<UserListDto>>());
}
@gconey, Great! Thanks a lot!
I have extended user with DateOfBirth, in UserAppService i have created GetBirthdayList()
public async Task<ListResultDto<UserListDto>> GetBirthDayList()
{
var query = from u in UserManager.Users.Where(p => p.IsActive)
let diffYears = DbFunctions.DiffYears(u.DateOfBirth, DateTime.Today)
let birthdayOccurred =
u.DateOfBirth.Month < DateTime.Today.Month
|| ((u.DateOfBirth.Day + 3) <= DateTime.Today.Day && u.DateOfBirth.Month == DateTime.Today.Month)
let nextBirthdate = DbFunctions.AddYears(u.DateOfBirth, diffYears + (birthdayOccurred ? 1 : 0))
let daysToBirthdate = DbFunctions.DiffDays(DateTime.Today, nextBirthdate)
orderby daysToBirthdate
select u;
var users = await query.Take(12).ToListAsync();
return new ListResultDto<UserListDto>(users.MapTo<List<UserListDto>>());
}
This list is visible for members of the Role Admin, but not for default Role "user", how to give role "user" view rights to birthdaylist without giving them create edit delete rights? Should i use userRepository instead of UserManager?
I hope my question is clear.
OOps , forget it. This works
private readonly IRepository<]My]OrganizationUnit, long> _organizationUnitRepository;
Hi, I have extended OrganizationUnit with, among others, property IsClinic when querying the organizationUnitRepository this extended properties or discriminator are not available.
var query =
from ou in _organizationUnitRepository.GetAll().Where(ou => ou.IsClinic)
Any tips?
public AspNetZeroAbpSession(
IPrincipalAccessor principalAccessor,
IMultiTenancyConfig multiTenancy,
ITenantResolver tenantResolver,
IAmbientScopeProvider<SessionOverride> ambientScopeProvider)
: base(principalAccessor, multiTenancy, tenantResolver, ambientScopeProvider)
{
}
Tried that but that only changes the paged rows, not the visible rows. I like to have 20 rows visiblie per page without scrolling.
maybe a stupid question, but where do i change the Visible rows per page for the usergrid in Angular 1.5?
Thanks in advance! Rene van Woezik
This tutorial helped me to publish an angular2 site to azure, hope this helps:
[https://docs.microsoft.com/en-us/azure/app-service-web/app-service-web-nodejs-get-started])
Hi, for a certain view i like to have All OrganizationUnits include there Members -> Member Name and ProfilePic. I'm banging my head against my keyboard but still can get it right.
I Tried this, but result is empty
var query = from uou in _userOrganizationUnitRepository.GetAll()
join ou in _organizationUnitRepository.GetAll() on uou.OrganizationUnitId equals ou.Id
join user in UserManager.Users on uou.UserId equals user.Id
where uou.OrganizationUnitId == input.Id
orderby input.Sorting
select new { uou, user };
Please advice